shell: add note

This commit is contained in:
Girish Ramakrishnan
2025-06-17 15:08:28 +02:00
parent 72d29030d9
commit 89cfe1ef57

View File

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