Skip to content
Snippets Groups Projects
Commit 82ff7c2f authored by Shane Tomlinson's avatar Shane Tomlinson
Browse files

Instead of using the NO_SIGNALS environment variable, use SUPPORTS_SIGNALS

parent 54c61fb2
No related branches found
No related tags found
No related merge requests found
......@@ -75,7 +75,7 @@ exports.handleTerminationSignals = function(app, callback) {
};
}
if (!process.env.NO_SIGNALS) {
if (process.env.SUPPORTS_SIGNALS) {
process.on('SIGINT', endIt('INT')).on('SIGTERM', endIt('TERM')).on('SIGQUIT', endIt('QUIT'));
}
};
......@@ -79,17 +79,17 @@ if (config.get('env').substr(0,5) === 'test_') {
}
// Windows can't use signals, so lets figure out if we should use them
// To force signals, NO_SIGNALS=true.
// To force signals, set the environment variable SUPPORTS_SIGNALS=true.
// Otherwise, they will be feature-detected.
var SIGNALS_PROP = 'NO_SIGNALS';
if (!(SINGALS_PROP in process.env)) {
var SIGNALS_PROP = 'SUPPORTS_SIGNALS';
if (!(SIGNALS_PROP in process.env)) {
try {
function signals_test() {}
process.on('SIGINT', signals_test);
process.removeListener('SIGINT', signals_test);
process.env[SIGNALS_PROP] = false;
} catch (noSignals) {
process.env[SIGNALS_PROP] = true;
} catch (noSignals) {
process.env[SIGNALS_PROP] = false;
}
}
......@@ -150,7 +150,7 @@ daemonNames.forEach(function(dn) {
});
});
if (!process.env[SIGNALS_PROP]) {
if (process.env[SIGNALS_PROP]) {
process.on('SIGINT', function () {
console.log('\nSIGINT recieved! trying to shut down gracefully...');
Object.keys(daemons).forEach(function (k) { daemons[k].kill('SIGINT'); });
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment