Next: , Previous: dgrey signals, Up: Usage


8.5 Controlling the Daemon

dgrey can be controlled in various ways through a local connection or an authenticated public connection. This is done using the dgrey-cmd command.

If dgrey-cmd fails to send the command, it will exit with a non-zero status code. This will also happen if the dgrey daemon sends a negative or unexpected reply to commands.

dgrey-cmd is started in this way:

     dgrey-cmd [OPTION].. COMMAND [ARGUMENT]...

Arguments are specified in the format KEY=VALUE. See examples below.

The following options are accepted:

-c, --connect=HOST:PORT
Specify host and port to connect to.
-l, --local-connect
Connect to the local listen socket read from the configuration file.
-p, --public-connect
Connect to the public listen socket read from the configuration file.
-f, --config-file=FILE
Read configuration from FILE. The only interesting options are the moment are ‘local-listen’ (only if --local-connect is specified), and ‘public-listen’ and ‘auth-key’ (only if --public-connect is specified).
-q, --quiet
Do not print any output. You can detect positive or negative result by checking the exit status of dgrey-cmd.
-s, --stdin
Read input for commands such as restore-greylist-database and restore-awl-database from standard input.
-i, --input-file=FILE
Read input for commands such as restore-greylist-database and restore-awl-database from FILE.
--help
Display help and option list, and exit.
--version
Output version information and exit.

Here is an example to tell dgrey to rotate its log file:

     dgrey-cmd -f /etc/dgrey/config -p -q rotate-action-log retain=20000