Next: Configuration, Previous: Quick start, Up: Top [Contents][Index]
The invocation syntax is:
direvent [options] [config]
where options are command line options discussed below and optional config supplies the configuration file to use instead of the default /etc/direvent.conf.
The options are:
Increase debug level.
Set syslog facility.
Remain in foreground.
Add dir to the beginning of the include search path (see include search path).
While connected to a terminal, direvent
outputs its diagnostics
messages to stderr and, if configured, to syslog. This option
limits the amount of information output to the standard error.
The prio argument is one of the following priorities (in order
of increasing severity): ‘debug’, ‘info’, ‘notice’,
‘warning’, ‘err’, ‘crit’, ‘alert’, ‘emerg’.
When this option is given, only messages with the priority level equal
to or greater than prio will be duplicated on the standard error.
Upon successful startup store the PID of the daemon process in file.
Run in self-test mode. In this mode, direvent
starts
external command supplied as the argument to this option and continues
running until the command exits. If command terminates normally,
direvent
exits with the code returned by it. If
command terminates on signal, direvent
exits with
code ‘0’ if this signal was SIGHUP
, and with code ‘2’
otherwise.
The command can include any command line options or arguments,
provided that it is properly quoted. It is invoked as
/bin/sh -c command
in the environment of
the parent direvent
process.
This mode is used in direvent
test suite. The idea is
to configure the handler (see handler) so that it sends
SIGHUP
to command before exiting. To this effect,
the special macro variable $self_test_pid
is
defined (see variable expansion) to the PID of the running
command process. For example, consider configuration file
test.conf, which contains the following:
watcher { path /tmp; command "/bin/kill -HUP $self_test_pid"; }
Then, the following command can be used to check whether
direvent
correctly reacts on file creation in
the watched directory:
$ direvent --foreground \ --self-test 'touch /tmp/file && /usr/bin/sleep 20 && exit 1' \ test.conf
The command will return ‘0’ if the handler was invoked, and ‘1’ if it was not.
Check configuration file for errors and exit.
Run as this user. This option overrides the user
configuration
statement (see user).
The following options are informative. They cause the program to display the requested piece of information and terminate:
Show configuration file summary.
Give a short usage summary.
Display available command line options.
Print program version.
Next: Configuration, Previous: Quick start, Up: Top [Contents][Index]