daemon.conf - Daemon configuration file for Daemon Manager
# Example conf file: start=exec ./daemon --flags # Line will be interpretted by /bin/sh dir=/some/working/dir # working dir default: / user=nobody # Who to run as default: the user output=log # "log" or "discard" default: discard autostart=no # "yes" or "no" default: yes export VAR=value # Set env variable "VAR" to "value"
This manual page describes the config files for daemons controlled by daemon-manager(1). The config files are loaded out of the user’s home directory: ~/.daemon-manager/daemons. Root’s config files are loaded from /etc/daemon-manager/daemons. Only files with the suffix “.conf” will be loaded.
The config files must not be world writable and must be owned by the user whose home directory they are in.
Each config file describes a single daemon.
The config file is a plain text file. The general format is
option = value
White space is stripped from around options and values.
Comments are stripped from lines before they are parsed. A comment starts with a "#" and continues to the end of a line.
Blank lines are ignored.
Environment variables for the process can be set with the export keyword:
export env_var = value
This resembles bash but is not. In particular, quotes are not interpreted in the config file, so don’t put quotes around value unless you want literal quote characters in your environment variable.
There are three default environment variables: HOME, LOGNAME, and PATH. Variables with the same name in the config file will override the defaults.
This is the line that will be fed to /bin/sh in order to start the daemon. This option is required. The daemon is required to stay in the foreground. If it tries to daemonize then daemon-manager(1) will think it has exited prematurely and will attempt to restart it. It is also a good idea to use sh's exec built-in to jettison the shell while launching the daemon.
This option specifies the working directory. The daemon will be started from this directory. If the dir option is not specified it defaults to “/”.
Use this option to specify which user the daemon should be run as. By default users are only allowed to start daemons as themselves. The system administrator can allow a user to run as another user by adding to the can_run_as section of the daemon-manager.conf(5) file. The HOME environment variable in the daemon’s process will default to the specified user’s home directory, and LOGNAME will default to the specified user’s login name.
This option controls whether stdout and stderr from the daemon should be logged or discarded.
The valid values for this option are “log” or “discard”, with “discard” being the default if the option is not specified.
If the daemons have been configured with the output option set to “log” then their stdout and stderr will be redirected to a log file in “~/.daemon-manager/log/<daemon>.log” where “<daemon>” is the basename of the .conf file.
If this option is “yes” or left unspecified then the daemon will be started automatically when daemon-manager(5) itself is started.
If this option is “no” then it will only be started by dmctl(1)'s “start” command.
daemon-manager(1), daemon-manager.conf(5), dmctl(1)