Hitachi

Job Management Partner 1 Version 10 Job Management Partner 1/Advanced Shell Description, User's Guide, Reference, and Operator's Guide


TRAP_ACTION_SIGTERM parameter (defines the job controller's action when a forced termination request is received)

Organization of this page

Format

In UNIX edition
#-adsh_conf TRAP_ACTION_SIGTERM {DISABLE|TERM|CONT|AUTO}
In Windows edition
#-adsh_conf TRAP_ACTION_SIGTERM {DISABLE|TERM}

Description

This parameter specifies whether the trap command can be used to define an operation to be performed when the job controller receives a forced termination request. It also specifies an action for the job controller after the operation defined by the trap command has been executed. Forced termination requests include forced termination operations from JP1/AJS - View, transmission of a SIGTERM signal by the kill command in UNIX, and forced termination by the taskkill command in Windows (immediate process termination by a means such as TerminateProcess).

When a forced termination request is received while a job definition script is running, the job controller operates according to the operand specified here.

If this parameter is omitted, the job controller assumes that DISABLE is specified.

For details about the trap command, see trap command (specifies the action when signals and forced termination requests are received) (UNIX only) in 9.3 Standard shell commands.

Operands

DISABLE

Specifies that an operation to be performed when a forced termination request is received cannot be defined by the trap command. If a forced termination request is received, the job controller will terminate with an error without executing the subsequent commands.

TERM

Specifies that an operation to be performed when a forced termination request is received can be defined by the trap command.

If a forced termination request is received, the job controller will perform the operation defined by the trap command, and then will terminate with an error without executing the subsequent commands.

In the UNIX edition, when a second forced termination request is received, the job terminates immediately without performing the job controller's postprocessing.

CONT (UNIX only)

Specifies that an operation to be performed when a forced termination request is received can be defined by the trap command.

If a forced termination request is received, the job controller will perform the operation defined by the trap command and is to continue processing even when subsequent forced termination requests are received.

Note that this operand is not applicable to jobs started from JP1/AJS. If this operand is specified for such a job, the job controller will issue the KNAX0474-E message during environment file analysis and then terminate with an error.

AUTO (UNIX only)

Specifies that the job controller is to assume that either TERM or CONT is specified, depending on the job start method. You specify this operand when you want to share the same environment file regardless of the job start method.

Target job

Operation

Job started from JP1/AJS

The job controller assumes that TERM is specified and operates accordingly.

Job started from a program other than JP1/AJS

The job controller assumes that CONT is specified and operates accordingly.

If the job is any of the following, the job controller assumes that the job was started from JP1/AJS:

  1. Job started from JP1/Advanced Shell's custom job

  2. Job started while TERM was set in the AJS_BJEX_STOP environment variable

  3. Child job started from 1 or 2

For details about the operation that is performed when a forced termination request is performed for each operand, see 3.10 Forcibly terminating jobs.

Notes

(Common to both UNIX and Windows)
  • When an operation to be performed when a forced termination request is received is defined by the trap command for a job and that job receives a forced termination request, the job is not terminated until the defined operation is completed. Keep this in mind when you define a command that takes a long time to execute or for an operation that is not terminated.

  • Even if an operation is defined by using the trap command within a job definition script, the defined operation does not take effect while normal postprocessing is underway during normal job termination. If a forced termination request is received during that time, the job controller assumes that no operation is defined by means of a trap command.

  • If the operation defined by the trap command terminates with an error or the job is cancelled by execution of the exit command, the job is terminated with the termination code of the last command that was executed within the operation defined by the trap command. However, if TERM is specified for this parameter, the operation defined by the trap command is terminated with the termination code when the forced termination request was received. The termination code of the operation defined by the trap command is not applied to the termination code of the job or job steps.

  • If this parameter is defined in both the system environment file and the job environment file, the definition in the job environment file takes effect.

(UNIX only)
  • If any of the conditions listed below is satisfied and a second forced termination request is received while the first termination request is still engaged in processing, such as terminating a descendant process, performing the operation defined by the trap command, or deleting temporary files, the postprocessing (including deletion of created temporary files) might not be completed. In such a case, take appropriate action, such as by deleting the temporary files manually.

    [Figure] DISABLE is specified in the operand.

    [Figure] TERM is specified in the operand.

    [Figure] CONT is specified in the operand and no operation is defined by the trap command.