luster-daemon
v2.0.1
Published
External daemonization for luster
Downloads
5
Readme
luster-daemon
External daemonization for luster.
Help screen:
$ npm install -g luster-daemon
$ luster-daemon --help
Luster daemon
Usage:
luster-runner <luster_config> [-p|--pid=<pid>] [-d|--daemon]
luster-runner -h | --help
luster-runner --version
Options:
-h --help Show this screen.
--version Show version.
-p <pid>, --pid=<pid> Write daemonized process pid(if daemonized) to specified file.
-d, --daemon Daemonize process
Quick start
Install this package in local or global scope of your system. Here we will be installing this package localy:
$ npm install luster-daemon
...
Next we should modify our application code. Application should send some message when it is ready, thats very important to daemonizer because it will detach only if application is ready. So, you should add this code:
if(process.send) {
process.send('online');
}
Finaly we could run it in detached mode like this:
$ luster-daemon path/to/luster.conf -p `pwd`/process.pid -d
Running luster application...
Saving pidfile to "/home/corpix/Code/luster-daemon/process.pid"
Waiting for `online` message from all(2) workers...
Worker "1" reported "online" status
Worker "2" reported "online" status
Ready