Upstart for Node.js
- Leverages existing Linux utilities
- Creates and runs Upstart scripts for Node.js applications to run them as daemons in the background
- Command-line interface to manage apps with a simple JSON config file
- Simple API to manage apps programmatically
- API and CLI to monitor processes
- Web interface to monitor and launch applications
- Commander 2.1.0
Nupstart CLI depends on a JSON config file located at /etc/nupstart/processfile. This file is created initially after running nupstart setup
and should be edited to reflect the apps you wish to manage with nupstart. The format is simple:
{
"myappname" : {
"script" : "/var/www/myappname/app.js",
"logfile" : "/var/log/myappname-nupstart.log"
},
"myotherapp" : {
"script" : "/var/www/myotherapp/main.js",
"logfile" : "/var/log/venus/myotherapp-nupstart.log"
}
}
Name and "script" are required. The "logfile" parameter is optional.
You can then start "myappname" as a daemon by running nupstart start myappname
. Or, start all apps by running nupstart start all
.
$ npm install https://github.com/imdevin567/nupstart/tarball/master -g # Install nupstart globally
$ nupstart setup # Run this after install to setup needed files and directories
$ nupstart start app # Create and run Upstart script for "app" specified in processfile
$ nupstart stop app # Stop "app" specified in processfile
$ nupstart start all # Creates and runs Upstart scripts for all apps specified in processfile
$ nupstart stop all # Stops all apps specified in processfile
$ nupstart clean # Stops all apps in processfile and removes existing Upstart scripts
$ nupstart stats # Outputs a json string of the process stats
Nupstart is available through the MIT license.