Hitachi

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


3.10.2 Processing when signals are received (UNIX only)

This subsection explains the processing that occurs when the job controller has received signals during normal execution and during debug execution.

Organization of this subsection

(1) During normal execution

This subsection explains for the SIGTERM signal and for other signals the processing that occurs when the job controller has received signals during normal execution.

(a) SIGTERM

The processing that occurs when SIGTERM has been received depends on the specified TRAP_ACTION_SIGTERM environment setting parameter.

Table 3‒10: When DISABLE is specified in the TRAP_ACTION_SIGTERM environment setting parameter#1

When an operation is not defined with the trap command

When an operation is defined with the trap command

  • If the root job received SIGTERM

    First time: Outputs a message, performs postprocessing, and then terminates without performing any subsequent processing. If the root job was not started from JP1/AJS, the root job sends SIGTERM to itself and then terminates with the signal.

    Second time: Terminates immediately.

  • If a child job received SIGTERM

    The child job that received SIGTERM outputs a message, performs postprocessing, and then terminates itself without performing any subsequent processing. In this case, the child job sends SIGTERM to itself and then terminates with the signal.#2

Operation cannot be defined with the trap command.#3

#1

This includes when the TRAP_ACTION_SIGTERM environment setting parameter is not specified.

#2

For details about the behavior of child jobs when signals are received, see 3.2.3(3) Behavior of child jobs when signals are received.

#3

When the action for SIGTERM is specified by the trap command, the job terminates with a trap command error.

Table 3‒11: When TERM is specified in the TRAP_ACTION_SIGTERM environment setting parameter

When an operation is not defined with the trap command

When an operation is defined the trap command

  • If the root job received SIGTERM

    First time: Outputs a message, performs postprocessing, and then terminates without performing any subsequent processing. If the root job was not started from JP1/AJS, the root job sends SIGTERM to itself and then terminates with the signal.

    Second time: Terminates immediately.

  • If a child job received SIGTERM

    The child job that received SIGTERM outputs a message, performs postprocessing, and then terminates itself without performing any subsequent processing. In this case, the child job sends SIGTERM to itself and then terminates with the signal.

    The parent job of the child job performs subsequent processing according to the results of the child process that terminated with termination code 128 + signal number of SIGTERM.#

  • If the root job received SIGTERM

    Outputs a message and then executes the action defined for SIGTERM with the trap command. After executing the action, the root job terminates without performing any subsequent processing. If the root job was not started from JP1/AJS, the root job sends SIGTERM to itself and then terminates with the signal.

  • If a child job received SIGTERM

    Outputs a message and then executes the action defined for SIGTERM with the trap command. After executing the action, the child job terminates without performing any subsequent processing.

    The parent job of the child job performs subsequent processing according to the results of the child process that received SIGTERM.#

#

For details about the behavior of child jobs when signals are received, see 3.2.3(3) Behavior of child jobs when signals are received.

Table 3‒12: When CONT is specified in the TRAP_ACTION_SIGTERM environment setting parameter

Job start method

When an operation is not defined with the trap command

When an operation is defined with the trap command

Started from JP1/AJS

(Started from a custom job or with TERM set in the AJS_BJEX_STOP environment variable)

The job definition script is not run and the job terminates with an error (error during environment file analysis).

Started using a method that does not involve JP1/AJS

(Started with a method other than the above)

  • If the root job received SIGTERM

    First time: Outputs a message, performs postprocessing, and then terminates without performing any subsequent processing. The root job sends SIGTERM to itself and then terminates with the signal.

    Second time: Terminates immediately.

  • If a child job received SIGTERM

    The behavior of a child job that has received SIGTERM is the same as that of the root job.

    The parent job of the child job performs subsequent processing according to the results of the child process that terminated with termination code 128 + signal number of SIGTERM.#

  • If the root job received SIGTERM

    Outputs a message and then executes the action defined for SIGTERM with the trap command. After executing the action, the root job performs any subsequent processing in the job definition script.

  • If a child job received SIGTERM

    The behavior of a child job that has received SIGTERM is the same as that of the root job.

    The parent job of the child job performs subsequent processing according to the results of the child process that received SIGTERM.#

#

For details about the behavior of child jobs when signals are received, see 3.2.3(3) Behavior of child jobs when signals are received..

Table 3‒13: When AUTO is specified in the TRAP_ACTION_SIGTERM environment setting parameter

Job start method

When an operation is not defined with the trap command

When an operation is defined with the trap command

Started from JP1/AJS

(Started from a custom job or with TERM set in the AJS_BJEX_STOP environment variable)

Same processing as when TERM is specified

Started using a method that does not involve JP1/AJS

(Started with a method other than the above)

Same processing as when CONT is specified

(b) Other than SIGTERM

Table 3‒14: Processing when signals are received

Type of signal

When an operation is not defined with the trap command

When an operation is defined the trap command

Termination request signal

SIGHUP, SIGINT, SIGXCPU, SIGXFSZ, SIGQUIT, SIGUSR1, SIGUSR2, SIGPIPE, SIGALRM, SIGVTALRM, SIGPROF

  • If the root job received the signal

    Performs postprocessing, such as termination of descendant processes and deletion of temporary files, and then terminates with an error by signal without executing any subsequent instruction.

  • If a child job received the signal

    The processing of the child job that received the signal is the same as when the signal was received by the root job.

    The parent job of the child job that received the signal performs subsequent processing according to the results of the terminated child job.#1

  • If the root job received the signal

    The processing depends on the operation defined by the trap command.

  • If a child job received the signal

    The processing of the child job that received the signal is the same as when the signal was received by the root job.

    The parent job of the child job that received the signal performs subsequent processing according to the results of the child job.

SIGMSG, SIGDANGER, SIGMIGRATE, SIGPRE, SIGVIRT, SIGALRM1, SIGRECONFIG, SIGCPUFAIL, SIGGRANT, SIGRETRACT, SIGSOUND

Same as above.

(AIX only)

Same as above.

(AIX only)

SIGLOST

Same as above.

(HP-UX and Solaris only)

Same as above.

(HP-UX and Solaris only)

Error notification signal

SIGILL, SIGTRAP, SIGABRT, SIGFPE, SIGBUS, SIGSEGV, SIGSYS

  • If the root job received the signal

    Terminates the program according to the default OS processing for the corresponding signal.

  • If a child job received the signal

    The processing of the child job that received the signal is the same as when the signal was received by the root job.

    The parent job of the child job that received the signal performs subsequent processing according to the results of the terminated child job.#1

  • If the root job received the signal

    The processing depends on the operation defined by the trap command.

  • If a child job received the signal

    The processing of the child job that received the signal is the same as when the signal was received by the root job.

    The parent job of the child job that received the signal performs subsequent processing according to the results of the child job.

SIGIOT, SIGEMT

Same as above.

(AIX, HP-UX, and Solaris only)

Same as above.

(AIX, HP-UX, and Solaris only)

SIGLOST

Same as above.

(AIX only)

Same as above.

(AIX only)

Other

  • If the root job received the signal

    Depends on the default OS processing for the corresponding signal.

  • If a child job received the signal

    The processing of the child job that received the signal is the same as when the signal was received by the root job.

    The parent job of the child job that received the signal performs subsequent processing according to the results of the child job.#1

  • If the root job received the signal

    The processing depends on the operation defined by the trap command.#2

  • If a child job received the signal

    The processing of the child job that received the signal is the same as when the signal was received by the root job.

    The parent job of the child job that received the signal performs subsequent processing according to the results of the child job.

#1

#2

  • For SIGKILL and SIGSTOP, the trap command cannot be used to define an operation.

  • For SIGWAITING, the trap command cannot be used to define an operation (AIX only).

Important note

If you set - for the operation when you are using the trap command, the operation to be performed when signals are received is reset to the default.

With some signals, the operation during debug execution differs from that described in the tables. For details about the differences in signal processing depending on whether an operation is defined with the trap command, see (2) During debug execution.

(2) During debug execution

Table 3‒15: Processing when signals are received during debug execution

Type of signal

When an operation is not defined with the trap command

When an operation is defined with the trap command

SIGINT

The debugger terminates execution of the job definition script and then waits for entry of a command.#

The debugger terminates execution of the job definition script and then waits for entry of a command.#

The processing depends on the operation defined by the trap command.

SIGCHLD, SIGTSTP, SIGTTOU, SIGURG, SIGWINCH, SIGIO, SIGPWR

Performs the next processing.

The processing depends on the operation defined by the trap command.

SIGSTKFLT

(Linux only)

SIGWAITING, SIGLWP, SIGFREEZE, SIGTHAW, SIGCANCEL, SIGXRES, SIGJVM1, SIGJVM2

(Solaris only)

Real-time signal

(HP-UX, Linux, and Solaris only)

#

For details about terminating a job definition script, see 6.2 CUI debugger (UNIX only).