mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2025-02-12 11:01:52 +00:00
Added crash restart support for non Upstart Init services
This commit is contained in:
parent
35138d630f
commit
b5bc6934a5
1 changed files with 2 additions and 1 deletions
|
@ -20,7 +20,8 @@ start() {
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
echo 'Starting service…' >&2
|
echo 'Starting service…' >&2
|
||||||
local CMD="$SCRIPT &> \"$LOGFILE\" & echo \$!"
|
local CMD="$SCRIPT -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, \"\"]); child.stdout.on('data', function (c) { }); child.stderr.on('data', function (c) { }); child.on('exit', function (status) { start(); }); } start();\" &> \"$LOGFILE\" & echo \$!"
|
||||||
|
|
||||||
cd /usr/local/mesh
|
cd /usr/local/mesh
|
||||||
su -c "$CMD" $RUNAS > "$PIDFILE"
|
su -c "$CMD" $RUNAS > "$PIDFILE"
|
||||||
echo 'Service started' >&2
|
echo 'Service started' >&2
|
||||||
|
|
Loading…
Reference in a new issue