In --no-daemon unlink of nonexisting pidfile

When running application using --no-deamon, when process is killed with signal SIGTERM, it exits with code 1, due to fact that pidfile does not exist
This commit is contained in:
Davis
2017-09-14 12:00:13 +03:00
committed by Julian Lam
parent 252be54b32
commit 7f95bdfe6f

View File

@@ -187,7 +187,9 @@ Loader.stop = function () {
killWorkers();
// Clean up the pidfile
fs.unlinkSync(pidFilePath);
if (nconf.get('daemon') !== 'false' && nconf.get('daemon') !== false) {
fs.unlinkSync(pidFilePath);
}
};
function killWorkers() {