mirror of
https://github.com/Ylianst/MeshAgent
synced 2026-01-08 03:23:27 +00:00
1. Added SIGTERM even for linux/macos
2. Hooked up 'serviceStop' event for linux/macos
This commit is contained in:
@@ -170,6 +170,16 @@ function serviceHost(serviceName)
|
||||
|
||||
this.run = function run()
|
||||
{
|
||||
if (process.platform != 'win32')
|
||||
{
|
||||
var SIGTERM_Handler = function _SIGTERM_Handler()
|
||||
{
|
||||
_SIGTERM_Handler.parent.emit('serviceStop');
|
||||
};
|
||||
SIGTERM_Handler.parent = this;
|
||||
process.on('SIGTERM', SIGTERM_Handler);
|
||||
}
|
||||
|
||||
for(var i = 0; i<process.argv.length; ++i)
|
||||
{
|
||||
switch(process.argv[i])
|
||||
|
||||
Reference in New Issue
Block a user