2.1.10 Performing user-specific postprocessing when a job is terminated forcibly
JP1/Advanced Shell enables you to perform user-specific postprocessing when a forced termination request is received from JP1/AJS by means of the UNIX SIGTERM signal or the Windows taskkill command (immediate termination of process by a means such as TerminateProcess). This feature enables the user to enhance operational flexibility by performing user-specific termination processing when a forced termination request is received. You must define the TRAP_ACTION_SIGTERM environment setting parameter in order to perform user-specific postprocessing when a forced termination request is received.
Note that the operand supported by the TRAP_ACTION_SIGTERM environment setting parameter is different between the UNIX edition and the Windows edition. For details about the TRAP_ACTION_SIGTERM environment setting parameter, see the description in TRAP_ACTION_SIGTERM parameter in the manual JP1/Advanced Shell.
The following shows an example:
- Contents of the environment variable
#-adsh_conf TRAP_ACTION_SIGTERM TERM
- Contents of the job definition script
#-adsh_job JOB01 trap "UAP_TERM" TERM UAP01
If a forced termination request is received while UAP01 is running, the job controller executes UAP_TERM, performs postprocessing (such as deleting allocated files and forcibly terminating descendant processes), and then terminates the job.