mirror of
https://github.com/Ylianst/MeshAgent
synced 2025-12-30 23:23:32 +00:00
Fixed init.d service issue
This commit is contained in:
@@ -2101,7 +2101,8 @@ function serviceManager()
|
||||
{
|
||||
// Crash Restart is enabled, but it isn't inherently supported by INIT, so we must fake it with JS
|
||||
var tmp_parameters = parameters.split('"').join('\\"');
|
||||
parameters = "-exec \\\"var child; process.on('SIGTERM', function () { child.removeAllListeners('exit'); child.kill(); process.exit(); }); function start() { child = require('child_process').execFile(process.execPath, [process.argv0, \\\"" + tmp_parameters + "\\\"]); child.stdout.on('data', function (c) { }); child.stderr.on('data', function (c) { }); child.on('exit', function (status) { start(); }); } start();\\\"";
|
||||
parameters = "var child; process.on('SIGTERM', function () { child.removeAllListeners('exit'); child.kill(); process.exit(); }); function start() { child = require('child_process').execFile(process.execPath, [process.argv0, " + '"' + tmp_parameters + '"' + "]); child.stdout.on('data', function (c) { }); child.stderr.on('data', function (c) { }); child.on('exit', function (status) { start(); }); } start();";
|
||||
parameters = '-b64exec ' + Buffer.from(parameters).toString('base64');
|
||||
}
|
||||
|
||||
// The following is the init.d script I wrote. Rather than having to deal with escaping the thing, I just Base64 encoded it to prevent issues.
|
||||
|
||||
Reference in New Issue
Block a user