Scope

Feature History

Related Issues

Support of this feature is subject to the following features:

Use Case

Users who schedule programs and scripts that are aware of SIGTERM signals can implement clean-up procedures on receipt of the signal. Clean-up includes e.g. removal of temporary files, disconnect from a database and similar tasks.

Implementation

JobScheduler Master

The following operations can be carried out from the JobScheduler Operating Center interface (JOC) or by use of the command line:

  1. Operation: kill immediately
  2. Operation: terminate with timeout
  3. Operation: terminate

See also

JobScheduler Universal Agent (JUA)

The JobScheduler Universal Agent uses a script to monitor and kill parent and child tasks.

The script is to be found  the ./bin folder of the JUA installation.

The -kill-script option can be  used to specify a different kill script if necessary. See the Command Line Options section in JobScheduler Universal Agent - Installation & Operation for more information.

See also

for more detailed information about the implementation.

Delimitation

Implementation Summary

The implementation of the different termination operations available for the JobScheduler Master and Universal Agent is summarized in the table below.

The links lead to the issues relevant to the implementation of the feature.

The termination operations available are:

 Windows
Standalone
Linux
Standalone
Windows
Classic Agent
Linux
Classic Agent
Windows
Universal Agent
Linux
Universal Agent
Shell job      
Terminatenot supported(tick)not supported

(tick)

JS-1420

not supported(tick)
Kill(tick)(tick)(tick)

(tick)

JS-1421

(tick)

JS-1468

(tick)

JS-1468

Timeout

(tick)

JS-1463

(tick)

JS-1463

(tick)(tick) 

(tick)

JS-1468

Shell job with monitor      
Terminatenot supported(tick)not supported(tick)not supported

(tick)

JS-1468

Kill(tick)(tick)(tick)(tick)

(tick)

JS-1382

(tick)

JS-1468

Timeout(tick)(tick)   

(tick)

JS-1382

API job      
Terminatenot supported(tick)not supported(tick)not supported(tick)
Kill(tick)(tick)(tick)(tick)(tick)(tick)
Timeout(tick)(tick)    

Task Termination in JOC

The following screenshot shows how a task can be terminated using the Task menu in JOC's Task pane. This pane is shown in the Jobs tab when the task is running and the task can be terminated either with timeout or immediately.

Examples

Using a SIGTERM trap to show the difference between the kill and terminate commands

Download the Example

job_trap_sigterm.job.xml.zip

Description

This example contains a job that uses a SIGTERM trap to show the difference between the <kill_task> and <terminate_task> commands provided by JOC.

The job job_trap_sigterm.job.xml shows how to trap the terminate command provided by JOC.

<?xml version="1.0" encoding="ISO-8859-1"?>
<job  title="test test">
    <script  language="shell">
        <![CDATA[
trap 'echo sigterm will be ignored' 15
for i in 1 2 3 4 5 6 7 8 9 0
do
date
sleep 10
done
sleep 60
        ]]>
    </script>

    <run_time />
</job>

Change Management References

References