Book Image

Node Web Development - Second Edition

By : David Herron
Book Image

Node Web Development - Second Edition

By: David Herron

Overview of this book

Table of Contents (17 chapters)
Node Web Development Second Edition
Credits
About the Author
Acknowledgement
About the Reviewers
www.PacktPub.com
Preface
Index

Starting Node servers at system startup


Earlier we started a Node server from the command line. While this is useful for testing and development, it's not useful for deploying an application in any normal sense. There are normal practices for starting server processes, which differ for each operating system. Implementing a Node server means starting it similarly to the other background processes (sshd, Apache, MySQL, and so on) using, for example, start/stop scripts.

The Node project does not include start/stop scripts for any operating system. It can be argued that it would be out of place for Node to include such scripts. Instead, Node server applications should include such scripts. The traditional way is that the init daemon manages background processes using scripts in the /etc/init.d directory. On Fedora and Red Hat, that's still the process, but other operating systems use other daemon managers such as Upstart or launchd.

Writing these start/stop scripts is only a part of what's required...