Site Tools


on_signal
no way to compare when less than two revisions

Differences

This shows you the differences between two versions of the page.


on_signal [2017/07/06 01:48] (current) – created - external edit 127.0.0.1
Line 1: Line 1:
 +======Synopsis:======
 +[[on]] [<modes>]signal [<serial#>] [-|^]<match> { <action> }
 +
 +======Description:======
 +This hook is triggered whenever an OS signal is received by the client.
 +
 +======Parameters:======
 +|$0   |symbolic name or number of the signal received (eg. "1" or "HUP") |
 +|$1   |signal count, the number of times this signal has remaining to be processed in this iteration of the main client loop. |
 +
 +This hook will be triggered twice for each signal, once for the signal number and once for the symbolic name.  Using the symbolic name in scripts is preferred, because the signal numbers can vary between operating systems.
 +
 +It is unclear how to make any sensible use of the signal count parameter, and this should probably be ignored.
 +
 +======Examples:======
 +
 +To close and reopen all open log files when a SIGUSR1 signal is received:
 +
 +   on ^signal "USR1 %" {
 +      fe ($logctl(REFNUMS ACTIVE)) logref {
 +         xecho -b Reopening log file $logctl(GET $logref FILENAME)
 +         @ logctl(SET $logref STATUS 0)
 +         @ logctl(SET $logref STATUS 1)
 +      }
 +   }
  
on_signal.txt · Last modified: 2017/07/06 01:48 by 127.0.0.1