[torqueusers] warning signals

Garrick Staples garrick at usc.edu
Tue Aug 14 17:26:53 MDT 2007


On Tue, Aug 14, 2007 at 04:10:56PM -0700, scoggins alleged:
> Being unfamiliar with setting this up in a script what would one  
> usually do to trap for those signals and maybe send an warning to the  
> application so
> that if it gets some signal the app can do what the users specify?

Depends on the language of your job script.  In bourne, use the 'trap' command:

$ help trap
trap: trap [-lp] [arg signal_spec ...]
    The command ARG is to be read and executed when the shell receives
    signal(s) SIGNAL_SPEC.  If ARG is absent (and a single SIGNAL_SPEC
    is supplied) or `-', each specified signal is reset to its original
    value.  If ARG is the null string each SIGNAL_SPEC is ignored by the
    shell and by the commands it invokes.  If a SIGNAL_SPEC is EXIT (0)
    the command ARG is executed on exit from the shell.  If a SIGNAL_SPEC
    is DEBUG, ARG is executed after every simple command.  If the`-p' option
    is supplied then the trap commands associated with each SIGNAL_SPEC are
    displayed.  If no arguments are supplied or if only `-p' is given, trap
    prints the list of commands associated with each signal.  Each SIGNAL_SPEC
    is either a signal name in <signal.h> or a signal number.  Signal names
    are case insensitive and the SIG prefix is optional.  `trap -l' prints
    a list of signal names and their corresponding numbers.  Note that a
    signal can be sent to the shell with "kill -signal $$".

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://www.supercluster.org/pipermail/torqueusers/attachments/20070814/6f50a068/attachment.bin


More information about the torqueusers mailing list