Details
-
Feature
-
Status: Released (View Workflow)
-
Major
-
Resolution: Fixed
-
None
Description
Current Situation
- The <kill_task ... immediately="yes"/> command exists but it sends a SIGKILL signal. A new command is required that sends a SIGTERM signal.
Desired Behavior
- Operation: kill immediately
- JOC sends <kill_task immediately="yes"/>
- The respective process is killed immediately with the signal SIGKILL.
- Operation: terminate with timeout
- JOC sends <kill_task immediately="yes" timeout="15"/>
- The respective process receives a SIGTERM signal. Should that process not terminate within the specified timeout then it will be killed with a signal SIGKILL.
- Operation: terminate
- JOC sends <kill_task immediately="yes" timeout="never"/>
- The respective process receives a SIGTERM signal. No monitoring of the termination of that process as in operation 2) is performed.
Delimitation
- This feature is intended for Unix platforms that implement the SIGTERM and SIGKILL signals. It is not intended for Windows platforms. For Windows systems exclusively the Kill Immediately command applies.
- When using traps then please consider that the process created by the <shell> element receives the signal. Subsequent scripts that are called within the <shell> element will not receive the signal. You could therefore
- configure traps directly within the <shell> element. The shell process will then receive and handle the signal.
- configure traps in a shell script that is added by an <include> element instead of being stated within the <shell> element. The included shell script will receive and handle the signal.
- forward signals to subsequent shell scripts that are called within a <shell> element.
Example
The job job_trap_sigterm.job.xml shows howto trap the terminate command provided by JOC.
- Start the job
- Terminate the task in JOC
- You will see the log message sigterm will be ignored
- The task will continue
<?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>
Attachments
Issue Links
- affects
-
JOC-69 The task functions "terminate" and "terminate with timeout" are labeled with (Unix) in addition
- Released
- is related to
-
DOC-35 Add documentation for terminating tasks
- Approved
-
JS-1420 SIGTERM on shell task on classic agent over tcp
- Released
- is required by
-
JOC-10 A new command to terminate a task with SIGTERM should exist
- Released
- relates to
-
JS-1307 SIGTERM on shell task with monitor is forwarded to shell process
- Released
- mentioned in
-
Page Loading...