Uploaded image for project: 'JS - JobScheduler'
  1. JS - JobScheduler
  2. JS-1163

<kill_task timeout="..."> with SIGTERM before SIGKILL

    XMLWordPrintable

Details

    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

      1. Operation: kill immediately
        • JOC sends <kill_task immediately="yes"/>
        • The respective process is killed immediately with the signal SIGKILL.
      2. 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.
      3. 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

          Activity

            People

              jz Joacim Zschimmer
              oh Oliver Haufe
              Uwe Risse Uwe Risse
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - 2 days, 4 hours
                  2d 4h
                  Remaining:
                  Remaining Estimate - 2 days, 4 hours
                  2d 4h
                  Logged:
                  Time Spent - Not Specified
                  Not Specified