mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-02 03:55:55 +01:00
ability to restart nodebb via executable
This commit is contained in:
12
loader.js
12
loader.js
@@ -14,10 +14,7 @@ var nconf = require('nconf'),
|
||||
|
||||
nbb.on('message', function(cmd) {
|
||||
if (cmd === 'nodebb:restart') {
|
||||
nbb.on('exit', function() {
|
||||
nbb_start();
|
||||
});
|
||||
nbb.kill();
|
||||
nbb_restart();
|
||||
}
|
||||
});
|
||||
},
|
||||
@@ -29,10 +26,17 @@ var nconf = require('nconf'),
|
||||
fs.unlinkSync(pidFilePath);
|
||||
}
|
||||
}
|
||||
},
|
||||
nbb_restart = function() {
|
||||
nbb.on('exit', function() {
|
||||
nbb_start();
|
||||
});
|
||||
nbb.kill();
|
||||
};
|
||||
|
||||
process.on('SIGINT', nbb_stop);
|
||||
process.on('SIGTERM', nbb_stop);
|
||||
process.on('SIGHUP', nbb_restart);
|
||||
|
||||
nbb_start();
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user