1
0
mirror of https://github.com/Ylianst/MeshAgent synced 2025-12-06 00:13:33 +00:00

Fixed bug on Upstart Linux platforms, where task didn't start correctly.

This commit is contained in:
Bryan Roe
2019-04-18 11:43:18 -07:00
parent 921c636bac
commit ec1a39af53
2 changed files with 8 additions and 8 deletions

File diff suppressed because one or more lines are too long

View File

@@ -146,7 +146,7 @@ function task()
child.stdin.write("whereis service | awk '{print $2}'\n\exit\n");
child.waitExit();
child.stdout.str = child.stdout.str.trim();
action += (child.stdout.str + ' ' + options.service + ' restart >/dev/null 2>&1 \n');
action += (child.stdout.str + ' ' + options.service + ' start >/dev/null 2>&1 \n');
break;
case 'upstart':
var child = require('child_process').execFile('/bin/sh', ['sh']);
@@ -156,7 +156,7 @@ function task()
child.stdin.write("whereis initctl | awk '{print $2}'\n\exit\n");
child.waitExit();
child.stdout.str = child.stdout.str.trim();
action += (child.stdout.str + ' ' + options.service + ' restart >/dev/null 2>&1 \n');
action += (child.stdout.str + ' start ' + options.service + ' >/dev/null 2>&1 \n');
break;
case 'systemd':
var child = require('child_process').execFile('/bin/sh', ['sh']);
@@ -166,7 +166,7 @@ function task()
child.stdin.write("whereis systemctl | awk '{print $2}'\n\exit\n");
child.waitExit();
child.stdout.str = child.stdout.str.trim();
action += (child.stdout.str + ' restart ' + options.service + ' >/dev/null 2>&1 \n');
action += (child.stdout.str + ' start ' + options.service + ' >/dev/null 2>&1 \n');
break;
default:
ret._rej('Unknown Service Platform: ' + require('service-manager').manager.getServiceType());