diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2009-06-14 21:44:53 +0300 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2009-06-14 21:44:53 +0300 |
commit | ca5ea14d5f324349b6b2ffdd56721d80d5134ad0 (patch) | |
tree | a2b2adb4e465f8853dbbd763fd21f6031bd270c2 /doc/pies.texi | |
parent | bb86001cb89791d23fc2c728b7253182ec6149fe (diff) | |
download | pies-ca5ea14d5f324349b6b2ffdd56721d80d5134ad0.tar.gz pies-ca5ea14d5f324349b6b2ffdd56721d80d5134ad0.tar.bz2 |
Fix and improve termination actions in pies.
* pies/pies.h (MAX_RETURN_CODE): Remove.
(STATUS_SIG_BIT, STATUS_CODE): New defines
(struct action): New fields next, nstat, status, command.
(struct component): Keep singly-linked list of termination
actions.
* pies/progman.c (run_command): New function.
(progman_cleanup): Redo iteration over termination actions.
* pies/pies.c (return_code_cfg_param): Pass offsets in
struct component.
(create_action): Accept signal numbers (SIG.* or SIG\+[0-9]+)
in tag.
(return_code_section_parser): Update.
(pies_check_status): Set *pid before returning pies_status_stale.
* doc/pies.texi: Document changes.
* NEWS: Updated.
Diffstat (limited to 'doc/pies.texi')
-rw-r--r-- | doc/pies.texi | 47 |
1 files changed, 42 insertions, 5 deletions
diff --git a/doc/pies.texi b/doc/pies.texi index 1d9df83..7f020f1 100644 --- a/doc/pies.texi +++ b/doc/pies.texi @@ -379,8 +379,9 @@ return-code @var{codes} @{ @} @end smallexample - Its argument is a list of exit codes. Exit codes can be specified -as decimal numbers, or as symbolic code names from the table below: + The @var{codes} argument is a list of exit codes or signal names. +Exit codes can be specified either as decimal numbers or as symbolic code +names from the table below: @multitable @columnfractions 0.5 0.3 @headitem Name @tab Numeric value @@ -402,9 +403,45 @@ as decimal numbers, or as symbolic code names from the table below: @item EX_CONFIG @tab 78 @end multitable - If the component exits with an exit code listed in @var{codes}, -@command{pies} executes actions specified by its substatements. These -are: +Signal codes can be given either as @samp{SIG+@var{n}}, where @var{n} +is the signal number, or as signal names from the following list: +@samp{SIGHUP}, @samp{SIGINT}, @samp{SIGQUIT}, @samp{SIGILL}, +@samp{SIGTRAP}, @samp{SIGABRT}, @samp{SIGIOT}, @samp{SIGBUS}, +@samp{SIGFPE}, @samp{SIGKILL}, @samp{SIGUSR1}, @samp{SIGSEGV}, +@samp{SIGUSR2}, @samp{SIGPIPE}, @samp{SIGALRM}, @samp{SIGTERM}, +@samp{SIGSTKFLT}, @samp{SIGCHLD}, @samp{SIGCONT}, @samp{SIGSTOP}, +@samp{SIGTSTP}, @samp{SIGTTIN}, @samp{SIGTTOU}, @samp{SIGURG}, +@samp{SIGXCPU}, @samp{SIGXFSZ}, @samp{SIGVTALRM}, @samp{SIGPROF}, +@samp{SIGWINCH}, @samp{SIGPOLL}, @samp{SIGIO}, @samp{SIGPWR}, +@samp{SIGSYS}. + + If the component exits with an exit code listed in @var{codes} +or is terminated on a signal listed in @var{codes}, +@command{pies} executes actions specified by its substatements. +They are executed in the order of their appearance below: + +@deffn {Pies Conf} exec @var{command} +Execute external command. Prior to execution of @var{command} all +file descriptors are closed. It inherits the environment from the +main @command{pies} process with the following additional variables: + +@table @env +@item PIES_VERSION +The @command{pies} version number (@value{VERSION}). + +@item PIES_COMPONENT +Tag of the terminated component (@pxref{Component Statement, tag}). + +@item PIES_PID +PID of the terminated component. + +@item PIES_SIGNAL +If the component terminated on signal, the number of that signal. + +@item PIES_STATUS +Program exit code. +@end table +@end deffn @deffn {Pies Conf} action @samp{disable | restart} If @samp{restart} is given, restart the component. This is the |