User Tools

Site Tools


on_signal

Differences

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

Link to this comparison view

on_signal [2009/08/29 19:02]
127.0.0.1 external edit
on_signal [2017/07/06 01:48] (current)
caf Create initial version to replace blank page
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 caf