mirror of
https://github.com/Ylianst/MeshAgent
synced 2025-12-15 07:43:50 +00:00
Fixed bug with systemd 'isRunning'
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -1715,7 +1715,7 @@ function serviceManager()
|
||||
var child = require('child_process').execFile('/bin/sh', ['sh']);
|
||||
child.stdout.str = '';
|
||||
child.stdout.on('data', function (chunk) { this.str += chunk.toString(); });
|
||||
child.stdin.write("systemctl status " + this.name + " | grep 'Main PID:' | awk '{print $3}'\nexit\n");
|
||||
child.stdin.write("systemctl status " + this.name + " | grep 'Main PID:' | awk 'NR==1{print $3}'\nexit\n");
|
||||
child.waitExit();
|
||||
return (parseInt(child.stdout.str.trim()) == process.pid);
|
||||
};
|
||||
@@ -1724,7 +1724,7 @@ function serviceManager()
|
||||
var child = require('child_process').execFile('/bin/sh', ['sh']);
|
||||
child.stdout.str = '';
|
||||
child.stdout.on('data', function (chunk) { this.str += chunk.toString(); });
|
||||
child.stdin.write("systemctl status " + this.name + " | grep 'Active:' | awk '{print $2}'\nexit\n");
|
||||
child.stdin.write("systemctl status " + this.name + " | grep 'Active:' | awk 'NR==1{print $2}'\nexit\n");
|
||||
child.waitExit();
|
||||
return (child.stdout.str.trim() == 'active');
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user