Page History
Table of Contents |
---|
Introduction
- Jobs are executed with JS7 Agents that handle termination of jobs.
- Termination of jobs can be caused by users from the JOC Cockpit and can performed automatically if a job exceeds a given timeout.
- As a prerequisite for termination by JOC Cockpit the Controller has to be connected to JOC Cockpit and the Agent has to be accessible to the Controller.
Termination of Jobs
Jobs can be terminated in one of the following ways:
- The job is configured with a timeout setting: if job execution exceeds the timeout then the job will be killed by the Agent.
- Jobs can be killed by use of the GUI operation and and by use of the JS7 - REST Web Service API:
- The cancel/kill operation kills a running job and fails the order.
- The suspend/kill operation kills a running job and suspends the order.
- Failed and suspended orders can be resumed.
Terminating Jobs on Unix
In Unix environments jobs receive the following signals:
- When a job should be killed then the Agent sends a SIGTERM signal.
- This signal can be ignored or can be handled by 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.
- This signal can be ignored or can be handled by job. For shell scripts a
- The job configuration includes the Grace timeout setting:
- The specified duration is applied after a SIGTERM signal has been sent by the Agent. This allows the job to terminate on its own, for example after some cleanup is performed.
- After the specified duration the Agent sends a SIGKILL signal that aborts the OS process.
Job scripts frequently spawn child processes that have to be killed similarly to their parent process.
- To this purpose the Agent makes use of the
kill_task.sh
script from itsvar_<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.
- The Agent therefore allows to specify an individual kill script from a command line option should the built-in
Terminating Jobs on Windows
For Windows environments the following applies when terminating jobs:
- The Agent makes use of the
kill_task.cmd
script that is available from itsvar_<port>/work
directory.- The script makes use of the
taskkill
command to kill the job's process and its children.
- The script makes use of the
- An individual kill script can be specified with a command line option on Agent startup.
Overview
Content Tools