Skip to main content
Solved

Rundeck 5.16.0 Version Kill tracked processes after execution on specific command

  • November 24, 2025
  • 1 reply
  • 47 views

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)? 

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!

1 reply

Forum|alt.badge.img
  • Dutonian
  • Answer
  • November 24, 2025

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!