Next: watcher, Previous: syslog, Up: Configuration [Contents][Index]
By default, each handler inherits the environment of the master
direvent
process augmented with the following variables:
The system-dependent event code (see the sysev_code
macro variable).
The system-dependent event name (see the sysev_name
variable). If several system-dependent events
are delivered, this variable contains their names separated with
single horizontal space character.
The generic event code (see the genev_code
variable).
The generic event name (see the genev_name
variable). If several generic events are delivered, this variable
contains their names separated with single horizontal space character.
The name of the affected file relative to the current working directory
(see the file
variable).
This environment can be further modified, using the environ
configuration statement:
environ { clear; keep pattern; set "name=value"; eval "value"; unset pattern; }
Statements inside the environ
block define operations that
modify the environment. Their arguments undergo variable expansion
(see variable expansion). The clear
and keep
statements are executed first. Then, the set
and unset
statements are applied in the order of their appearance in the
configuration.
Clears the environment by removing (unsetting) all variables, except
those listed in keep
statements, if such are given (see below).
The clear
statement is always executed first.
Declares variables matching pattern as exempt from clearing.
This statement implies clear
.
The pattern is either a variable name or a globbing pattern matching one or more names.
In the second form, the variable will be retained only if it has the given value. Note, that the argument must be quoted.
For example, the following configuration fragment removes from the environment all variables except ‘HOME’, ‘USER’, ‘PATH’, and variables beginning with ‘DIREVENT_’:
environ { clear; keep HOME; keep USER; keep PATH; keep "DIREVENT_*"; }
Assigns value to the environment variable name. The value is
subject to variable expansion using the same syntax as in shell.
The set
, eval
, and unset
(see below) statements
are executed in order of their appearance. For example
environ { set "MYLIB=$HOME/lib"; set "LD_LIBRARY_PATH=$LD_LIBRARY_PATH${LD_LIBRARY_PATH:+:}$MYLIB"; }
Perform variable expansion on expr and discard the result. This
is useful for side-effects. For example, to provide default value for
the LD_LIBRARY_PATH
variable, one may write:
environ { eval "${LD_LIBRARY_PATH:=/usr/local/lib}"; }
Unset environment variables matching pattern.
The pattern is either a variable name or a globbing pattern matching one or more names.
In the second form, the variable will be unset only if it has the given value. Note, that the argument must be quoted.
E.g., the following will unset the LOGIN
variable:
unset LOGIN;
The following statement will unset all variables starting with ‘LD_’:
unset "LD_*";
Notice, that patterns containing wildcard characters must be quoted.
Next: watcher, Previous: syslog, Up: Configuration [Contents][Index]