25.06.2015 Views

Administering Platform LSF - SAS

Administering Platform LSF - SAS

Administering Platform LSF - SAS

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 31<br />

Configuring Job Controls<br />

Using a command as a job control action<br />

TERMINATE job actions<br />

The following apply to a job control action that is a command:<br />

◆<br />

◆<br />

◆<br />

◆<br />

◆<br />

The command line for the action is run with /bin/sh -c so you can use<br />

shell features in the command.<br />

The command is run as the user of the job.<br />

All environment variables set for the job are also set for the command<br />

action.<br />

The following additional environment variables are set:<br />

❖ LSB_JOBPGIDS—a list of current process group IDs of the job<br />

❖ LSB_JOBPIDS—a list of current process IDs of the job<br />

For the SUSPEND action command, the following environment variable is<br />

also set:<br />

LSB_SUSP_REASONS—an integer representing a bitmap of suspending<br />

reasons as defined in lsbatch.h.<br />

The suspending reason can allow the command to take different actions<br />

based on the reason for suspending the job.<br />

The standard input, output, and error of the command are redirected to the<br />

NULL device, so you cannot tell directly whether the command runs<br />

correctly. The default null device on UNIX is /dev/null.<br />

You should make sure the command line is correct. If you want to see the<br />

output from the command line for testing purposes, redirect the output to<br />

a file inside the command line.<br />

Use caution when configuring TERMINATE job actions that do more than just<br />

kill a job. For example, resource usage limits that terminate jobs change the<br />

job state to SSUSP while <strong>LSF</strong> waits for the job to end. If the job is not killed by<br />

the TERMINATE action, it remains suspended indefinitely.<br />

TERMINATE_WHEN parameter (lsb.queues)<br />

Syntax<br />

In certain situations you may want to terminate the job instead of calling the<br />

default SUSPEND action. For example, you may want to kill jobs if the run<br />

window of the queue is closed. Use the TERMINATE_WHEN parameter to<br />

configure the queue to invoke the TERMINATE action instead of SUSPEND.<br />

See the <strong>Platform</strong> <strong>LSF</strong> Reference for information about the lsb.queues file<br />

and the TERMINATE_WHEN parameter.<br />

TERMINATE_WHEN = [LOAD] [PREEMPT] [WINDOW]<br />

<strong>Administering</strong> <strong>Platform</strong> <strong>LSF</strong> 393

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!