shell/task: better logs

This commit is contained in:
Girish Ramakrishnan
2025-07-17 02:04:50 +02:00
parent 63053f46a8
commit c796e724aa
2 changed files with 3 additions and 1 deletions

View File

@@ -92,8 +92,10 @@ function spawn(tag, file, args, options) {
});
signal?.addEventListener('abort', () => {
debug(`${tag}: aborting ${cp.pid}`);
child_process.execFile('/usr/bin/sudo', [ KILL_CHILD_CMD, cp.pid, process.pid ], { encoding: 'utf8' }, (error, stdout, stderr) => {
if (error) debug(`${tag}: failed to kill children`, stdout, stderr);
else debug(`${tag}: aborted ${cp.pid}`, stdout, stderr);
});
}, { once: true });