Configuring the Processes¶
The first section in
process: slimta: daemon: false logging: !include logging.yaml
It has a single sub-section,
slimta, which manage settings for the
slimta executables. You can use the
--process-name command-line option
to control this behavior. Each sub-section shares the same possible settings:
Whether or not the executables should daemonize on startup. This option can be overriden by the
--no-daemoncommand-line option. This value is False by default.
If given, the process will attempt to drop root privileges to this username. This is useful for when using privileged ports 25, 465, and/or 587. By default, privileges are not dropped by the process.
useroption, the process will attempt to drop privileges to this group name. By default, privileges are not dropped by the process.
If given, this path will be opened in append-mode (and created if necessary) and all standard output will be written to it instead of the console. This is particularly useful when daemonized. By default, the standard output stream is not redirected.
stdoutoption, this redirects the standard error stream to the given path in append mode. By default, the standard error stream is not redirected.
See the section on logging below. It’s often convenient to put logging configs in a separate config file, like in the example above. By default, debug-level logging is written to standard output.
logging sub-section is parsed into a dictionary-like object, it
is compatible with the
logging.config.dictConfig() function. The
dictionary schema explains how to use this configuration, and the
logging.conf sample config has a good starting point.
A more advanced, logging config that produces log files ready for rotation in a readable and parseable format might look like this:
version: 1 formatters: console: format: '%(levelname)-8s %(name)-15s %(message)s' default: format: '%(asctime)s %(levelname)s %(name)s %(message)s' handlers: console: class: logging.StreamHandler level: DEBUG formatter: console stream: !!python/name:sys.stdout file: class: logging.handlers.WatchedFileHandler level: DEBUG formatter: default filename: '/var/log/slimta/slimta.log' loggers: celery: level: WARNING propagate: true slimta: level: DEBUG propagate: true root: level: DEBUG handlers: [file]