mirror of
https://github.com/Ylianst/MeshAgent
synced 2025-12-15 07:43:50 +00:00
Updated, so on INIT platforms when crash restart is specified, parameters can still be passed
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -1197,8 +1197,8 @@ function serviceManager()
|
|||||||
if (options.failureRestart == null || options.failureRestart > 0)
|
if (options.failureRestart == null || options.failureRestart > 0)
|
||||||
{
|
{
|
||||||
// Crash Restart is enabled, but it isn't inherently supported by INIT, so we must fake it with JS
|
// Crash Restart is enabled, but it isn't inherently supported by INIT, so we must fake it with JS
|
||||||
var tmp_parameters = parameters;
|
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, ['sh']); child.stdout.on('data', function (c) { }); child.stderr.on('data', function (c) { }); child.on('exit', function (status) { start(); }); } start();\\\"";
|
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();\\\"";
|
||||||
}
|
}
|
||||||
|
|
||||||
// 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.
|
// 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