...
Jira | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
Use Case
- Welche Rolle ist für den Fall verantwortlich? Wer will etwas? Engineering, Operating, Business
- Was ist das Ziel? Was ist das Mittel? Was ist die Motivation?
The information contained in this article draws together detailed information contained in a range of issues and should primarily be of interest to persons in engineering and to a lesser extent persons in operating functions.
...
- Operation: kill immediately
- JOC sends
<kill_task immediately="yes"/>
- The process is killed immediately using the SIGKILL signal.
- JOC sends
- Operation: terminate with timeout
- JOC sends
<kill_task immediately="yes" timeout="15"/>
- The process receives a SIGTERM signal. Should that process not terminate within the specified timeout period then it will be killed with a SIGKILL signal.
- JOC sends
- 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.The process receives a SIGTERM signal. Monitoring of the process termination as described in operation Operation 2 . above is not carried out.
- JOC sends
Delimitation
...
A monitor (i.e. a pre-/postprocessing script) has to be configured for shell jobs that have a timeout set (JS-1463).
For example:Code Block language xml title Workaround for shell jobs with a timeout <job name="shell_with_javascript_monitor"> <script language="shell"> <![CDATA[ echo hello world! sleep 45 ]]> </script> <monitor name="process0" ordering="0"> <script language="java:javascript"> <![CDATA[ function spooler_process_before(){ return true; } ]]> </script> </monitor> <run_time /> </job>
Example
- Beispiel Code und Erläuterungen
- Code Beispiel via Confluence Code Macro
- Beispiel Objekte
- Ganze Objekte wie jobs, orders etc nur als Anhang
Download the Example
...
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.
...
Code Block | ||
---|---|---|
| ||
<?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> |
Additional resources
References
...
- JIRA Issues
...
- JobScheduler Reference Documentation: