properly handling SIGHUP

v1.18.x
Julian Lam 11 years ago
parent 8baea1a251
commit 956a431950

@ -9,7 +9,6 @@ var nconf = require('nconf'),
/* TODO /* TODO
* pidFile and reset timer * pidFile and reset timer
* logging * logging
* handling SIGHUP
* restart signal from child * restart signal from child
* minifier * minifier
*/ */
@ -150,6 +149,9 @@ Loader.init = function() {
console.log('[cluster] Child Process (' + worker.process.pid + ') has exited (code: ' + code + ')'); console.log('[cluster] Child Process (' + worker.process.pid + ') has exited (code: ' + code + ')');
cluster.fork(); cluster.fork();
}); });
process.on('SIGHUP', Loader.restart);
// fs.writeFile(__dirname + '/pidfile', process.pid);
}; };
Loader.restart = function(callback) { Loader.restart = function(callback) {

Loading…
Cancel
Save