1
0
mirror of https://github.com/Ylianst/MeshAgent synced 2026-01-09 03:53:26 +00:00

Fixed bug with service.isMe() for init and upstart linux

This commit is contained in:
Bryan Roe
2019-09-13 14:41:19 -07:00
parent c4a5c69969
commit 92fe765c32
2 changed files with 14 additions and 14 deletions

View File

@@ -1076,11 +1076,11 @@ function serviceManager()
child.stdout.on('data', function (chunk) { this.str += chunk.toString(); });
if (isMe.platform == 'upstart')
{
child.stdin.write("initctl status " + this.name + " | awk '{print $2}' | awk -F, '{print $4}'\nexit\n");
child.stdin.write("initctl status " + this.name + " | awk '{print $NF}'\nexit\n");
}
else
{
child.stdin.write("service " + this.name + " status | awk '{print $2}' | awk -F, '{print $4}'\nexit\n");
child.stdin.write("service " + this.name + " status | awk '{print $NF}'\nexit\n");
}
child.waitExit();
return (parseInt(child.stdout.str.trim()) == process.pid);