When a job (Unix or Windows) is manually terminated or canceled via the Automic Web Interface (AWI), the main process is killed, but its child processes (sub-processes) continue to run on the operating system as "process remnants."
On Linux/Unix: A script launching background tasks (e.g., sleep &) leaves the background tasks running even after the parent script is killed.
On Windows: A job launching external scripts or binaries leaves those binaries running in the background.
Version: Any
Agent type: Windows or UNIX/Linux
This behavior is typically due to how the Operating System handles process signals:
Unix/Linux: By default, the Agent sends a SIGKILL (kill -9). This immediately terminates the parent process, but the parent does not have the opportunity to pass the signal to its children, leaving them "orphaned."
Windows: Standard process termination may not automatically include the entire process tree unless specific job objects are used.
Modify the Agent's .ini file to use a signal that allows for graceful termination of the process tree.
Open the Unix Agent configuration file (ucxjxxx.ini).
Locate the killSignal= parameter.
Change the value from SIGKILL (default) to SIGTERM.
killSignal=SIGTERM
Restart the Agent.
Note: This allows the process to receive a kill -15, which typically triggers the termination of child processes depending on the script's logic.
Enable the use of Windows Job Objects to ensure the entire process tree is terminated.
Open the Windows Agent configuration file (ucxjwx6.ini).
Set the following parameter:
useJobObject=1
Restart the Agent.
This ensures that when the main job is killed, Windows terminates all processes associated with that Job Object.