diff --git a/src/shell.js b/src/shell.js index d705e35ee..81dc0a519 100644 --- a/src/shell.js +++ b/src/shell.js @@ -161,6 +161,7 @@ function sudo(tag, args, options, callback) { // for us, this means that calling kill from this node process doesn't work since it's in the same group (and ubuntu 22 doesn't have the above fix). // the workaround is to invoke a kill from a different process group and this is done by starting detached // another idea is: use "ps --pid cp.pid -o pid=" to get the pid of the command and then send it signal directly + // ...despite all this hackery this only appears to work for sudo tail and not for sudo systemd-run . go figure. cp.terminate = function () { cp.terminated = true; // hint for better debug message in 'exit' child_process.spawn('kill', ['-SIGTERM', cp.pid], { detached: true }, (error) => { if (error) debug(`${tag} could not terminate`, error); });