Next: , Previous: , Up: Top   [Contents][Index]


4 Invocation

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:

-d
--debug

Increase debug level.

-F name
--facility=name

Set syslog facility.

-f
--foreground

Remain in foreground.

-I dir
--include=dir

Add dir to the beginning of the include search path (see include search path).

-l prio

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.

-P file
--pidfile=file

Upon successful startup store the PID of the daemon process in file.

-T command
--self-test=command

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.

-t
--lint

Check configuration file for errors and exit.

-u name
--user=name

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:

-H
--config-help

Show configuration file summary.

-h
--help

Give a short usage summary.

--usage

Display available command line options.

-V
--version

Print program version.


Next: , Previous: , Up: Top   [Contents][Index]