25.06.2015 Views

Administering Platform LSF - SAS

Administering Platform LSF - SAS

Administering Platform LSF - SAS

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 28<br />

Pre-Execution and Post-Execution Commands<br />

UNIX<br />

Windows<br />

Example<br />

The entire contents of the configuration line of the pre- and post-execution<br />

commands are run under /bin/sh -c, so shell features can be used in the<br />

command.<br />

For example, the following is valid:<br />

PRE_EXEC = /usr/share/lsf/misc/testq_pre >> /tmp/pre.out<br />

POST_EXEC = /usr/share/lsf/misc/testq_post | grep -v "Hey!"<br />

The pre- and post-execution commands are run in /tmp.<br />

Standard input and standard output and error are set to /dev/null. The<br />

output from the pre- and post-execution commands can be explicitly<br />

redirected to a file for debugging purposes.<br />

The PATH environment variable is set to:<br />

PATH='/bin /usr/bin /sbin /usr/sbin'<br />

The pre- and post-execution commands are run under cmd.exe /c.<br />

Standard input and standard output and error are set to NULL. The output from<br />

the pre- and post-execution commands can be explicitly redirected to a file for<br />

debugging purposes.<br />

See “LSB_PRE_POST_EXEC_USER parameter (lsf.sudoers)” on page 369.<br />

See the <strong>Platform</strong> <strong>LSF</strong> Reference for information about the lsf.sudoers file.<br />

The following queue specifies the pre-execution command<br />

/usr/share/lsf/pri_prexec and the post-execution command<br />

/usr/share/lsf/pri_postexec.<br />

Begin Queue<br />

QUEUE_NAME = priority<br />

PRIORITY = 43<br />

NICE = 10<br />

PRE_EXEC = /usr/share/lsf/pri_prexec<br />

POST_EXEC = /usr/share/lsf/pri_postexec<br />

End Queue<br />

LSB_PRE_POST_EXEC_USER parameter (lsf.sudoers)<br />

Example<br />

By default, both the pre- and post-execution commands are run as the job<br />

submission user. Use the LSB_PRE_POST_EXEC_USER parameter in<br />

lsf.sudoers to specify a different user ID for queue-level pre- and postexecution<br />

commands.<br />

For example, if the pre- or post-execution commands perform privileged<br />

operations that require root permission, specify:<br />

LSB_PRE_POST_EXEC_USER=root<br />

See the <strong>Platform</strong> <strong>LSF</strong> Reference for information about the lsf.sudoers file.<br />

<strong>Administering</strong> <strong>Platform</strong> <strong>LSF</strong> 369

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

Saved successfully!

Ooh no, something went wrong!