1
0
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:
Bryan Roe
2019-02-21 08:15:32 -08:00
parent cefd3018d9
commit d12afc14a6
2 changed files with 15 additions and 12 deletions

View File

@@ -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;