diff --git a/loader.js b/loader.js index eb29cdca74..f2a511336b 100644 --- a/loader.js +++ b/loader.js @@ -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() {