mirror of
https://github.com/Ylianst/MeshAgent
synced 2025-12-28 14:13:37 +00:00
1. Fixed Service Detection on SystemD, and changed to use auto-restart instead of systemctrl restart, to remove dependency on restart=always
This commit is contained in:
@@ -385,17 +385,18 @@ function serviceManager()
|
||||
conf.write('[Install]\n');
|
||||
conf.write('WantedBy=multi-user.target\n');
|
||||
conf.write('Alias=' + options.name + '.service\n'); break;
|
||||
this._update = require('child_process').execFile('/bin/sh', ['sh'], { type: require('child_process').SpawnTypes.TERM });
|
||||
this._update._moduleName = options.name;
|
||||
this._update.stdout.on('data', function (chunk) { });
|
||||
this._update.stdin.write('systemctl enable ' + options.name + '.service\n');
|
||||
this._update.stdin.write('exit\n');
|
||||
this._update.waitExit();
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
conf.end();
|
||||
|
||||
this._update = require('child_process').execFile('/bin/sh', ['sh'], { type: require('child_process').SpawnTypes.TERM });
|
||||
this._update._moduleName = options.name;
|
||||
this._update.stdout.on('data', function (chunk) { });
|
||||
this._update.stdin.write('systemctl enable ' + options.name + '.service\n');
|
||||
this._update.stdin.write('exit\n');
|
||||
this._update.waitExit();
|
||||
break;
|
||||
default: // unknown platform service type
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user