Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

In Unix environments jobs receive the following signals from the Agent:

  • When a job should be killed then the Agent sends a SIGTERM signal.
    • This signal can be ignored or can be handled by a job. For shell scripts a trap can be defined to e.g. perform cleanup tasks such as disconnecting from a database or removing temporary files.
  • The job configuration includes the Grace timeout setting:
    • The specified Grace Timeout duration is applied after a SIGTERM signal (corresponding to kill -15) has been sent by the Agent. This allows the job to terminate on its own, for example after some cleanup is performed.
    • Should the job still run after the specified Grace Timeout duration then the Agent sends a SIGKILL signal (corresponding to kill -9) that aborts the OS process.

Job scripts frequently spawn child processes that have to be killed similarly accordingly to their parent process.

  • By default the OS removes child processes if the parent process is killed. However, this mechanism is not applicable for all situations, depending on the way how child processes have been spawned.
  • To reliably kill child processes To this purpose the Agent makes use of the kill_task.sh script from its var_<port>/work directory.
    • This script retrieves the process tree of the job script and tries to kill any child processes.
  • Though the Agent is platform independent it is evident that retrieval of a process tree does not necessarily use the same command (ps) and options for any Unixes.
    • The Agent therefore allows to specify an individual kill script from a command line option should the built-in kill_task.sh script not be applicable to your Unix platform.

...