Startup script for Linux-based systems for running node app when rebooting using an /etc/init.d script.
Shell
Switch branches/tags
Nothing to show
Pull request Compare This branch is 3 commits ahead, 44 commits behind chovy:master.
Latest commit 75ef97e Apr 1, 2014 @cgrieger cgrieger Removed local path
Permalink
Failed to load latest commit information.
init.d Removed local path Apr 1, 2014
LICENSE Adapted to basic cmd. Apr 1, 2014
README.md Adapted README.md Apr 1, 2014

README.md

node-startup

Startup script for Linux-based systems for running 'grunt server' or any other command when rebooting from /etc/init.d script.

Set the APP_DIR and CMD variables in init.d/node-app.

Copy the startup script node-app to your /etc/init.d directory

sudo bash -l
cp ./init.d/node-app /etc/init.d/

Test that it all works:

/etc/init.d/node-app start
/etc/init.d/node-app status
/etc/init.d/node-app restart
/etc/init.d/node-app stop

Add node-app to the default runlevels

update-rc.d node-app defaults

Finally, reboot to be sure app starts automatically

reboot

Supported OS

Tested with Debian 6.0, but it should work on other Linux systems that use startup scripts in /etc/init.d (Redhat, CentOS, Gentoo, Ubuntu, etc).

Gotchas

If there is a app.pid file already, but node is not running, and you try to start it will not start. You will have to manually remove the .pid file and run it again.

I will add a --force in the near future.

LICENSE

(The MIT License)