node-init icon indicating copy to clipboard operation
node-init copied to clipboard

Synchronous alternatives

Open ghost opened this issue 13 years ago • 0 comments

I've added synchronous calls to this module (for running only) as the daemon module does not support forking unless it is done during the first tick of v8. And the only way to ensure this is happening is synchronous calls.

Sample init.d script for a forking process:

if (require('cluster').isMaster) {
    require('init').simple({
        pidfile : '/var/run/sample.pid',
        logfile : '/var/log/sample.log',
        runSync : function() {
            // ... master code here
        }
    });
} else {
    // ... worker code here
}

ghost avatar Aug 30 '12 15:08 ghost