Hello, is there a way to "Kill tracked processes after execution" the PID child when i kill a job that running for a specific command(Not a job)?
Solved
Rundeck 5.16.0 Version Kill tracked processes after execution on specific command
Best answer by MegaDrive68k
Hi. By default, Rundeck will send a SIGTERM (and optionally a SIGKILL) to the main process it tracks, but unless the parent process properly forwards signals, child processes (created with e.g. sh, bash, or via & in scripts) may not be terminated (check this: https://stackoverflow.com/a/72609407).
So a good way could be run your commands in the following way:
your-command args & pid=$!
and then terminate it with:
kill -- -$pid
Regards!
Login to PagerDuty Commons
No account yet? Create an account
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.