mirror of
https://github.com/Ylianst/MeshAgent
synced 2026-01-05 01:54:00 +00:00
Fixed bug/issue with systemd when trying to restart self
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -1729,19 +1729,19 @@ function serviceManager()
|
||||
return (child.stdout.str.trim() == 'active');
|
||||
};
|
||||
ret.start = function start() {
|
||||
var child = require('child_process').execFile('/bin/sh', ['sh']);
|
||||
var child = require('child_process').execFile('/bin/sh', ['sh'], { type: require('child_process').SpawnTypes.TERM });
|
||||
child.stdout.on('data', function (chunk) { });
|
||||
child.stdin.write('systemctl start ' + this.name + '\nexit\n');
|
||||
child.waitExit();
|
||||
};
|
||||
ret.stop = function stop() {
|
||||
var child = require('child_process').execFile('/bin/sh', ['sh']);
|
||||
var child = require('child_process').execFile('/bin/sh', ['sh'], { type: require('child_process').SpawnTypes.TERM });
|
||||
child.stdout.on('data', function (chunk) { });
|
||||
child.stdin.write('systemctl stop ' + this.name + '\nexit\n');
|
||||
child.waitExit();
|
||||
};
|
||||
ret.restart = function restart() {
|
||||
var child = require('child_process').execFile('/bin/sh', ['sh']);
|
||||
var child = require('child_process').execFile('/bin/sh', ['sh'], { type: require('child_process').SpawnTypes.TERM });
|
||||
child.stdout.on('data', function (chunk) { });
|
||||
child.stdin.write('systemctl restart ' + this.name + '\nexit\n');
|
||||
child.waitExit();
|
||||
|
||||
Reference in New Issue
Block a user