From 956a4319506e3a6dd94f2b98ce95f2e21c4a0bd0 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Thu, 4 Sep 2014 00:56:50 -0400 Subject: [PATCH] properly handling SIGHUP --- loader.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/loader.js b/loader.js index d819e0e7bb..99c6a9f1b4 100644 --- a/loader.js +++ b/loader.js @@ -9,7 +9,6 @@ var nconf = require('nconf'), /* TODO * pidFile and reset timer * logging - * handling SIGHUP * restart signal from child * minifier */ @@ -150,6 +149,9 @@ Loader.init = function() { console.log('[cluster] Child Process (' + worker.process.pid + ') has exited (code: ' + code + ')'); cluster.fork(); }); + + process.on('SIGHUP', Loader.restart); + // fs.writeFile(__dirname + '/pidfile', process.pid); }; Loader.restart = function(callback) {