diff --git a/packages/node_modules/node-red/red.js b/packages/node_modules/node-red/red.js index 26b6d1fc8..e758a00f3 100755 --- a/packages/node_modules/node-red/red.js +++ b/packages/node_modules/node-red/red.js @@ -342,8 +342,14 @@ process.on('uncaughtException',function(err) { process.exit(1); }); -process.on('SIGINT', function () { +function brexit() { RED.stop().then(function() { process.exit(); }); -}); +} + +process.on('SIGINT', brexit); +process.on('SIGTERM', brexit); +process.on('SIGHUP', brexit); +process.on('SIGUSR2', brexit); // for nodemon restart +process.on('SIGBREAK', brexit); // for windows ctrl-break