2.6.21 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. 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 TRAP_ACTION_SIGTERM parameter (defines the job controller's action when a forced termination request is received) in 7. Parameters Specified in the Environment Files.
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 "SIGTERM_received" TERM UAP01
If a forced termination request is received while UAP01 is running, the job controller executes SIGTERM_received, performs postprocessing (such as deleting allocated files and forcibly terminating descendant processes), and then terminates the job.