mod_posix
Prosody automatically detects the current platform and loads a corresponding module to handle platform-specific features, e.g. daemonize or logging integration.
This module is automatically loaded when the platform is detected as POSIX, i.e. most Linux and UNIX systems.
This module is required if you wish to daemonize Prosody, have it log to the syslog and respond to signals in a posix compliant environment.
Details
mod_posix implements POSIX. If using the Debian/Ubuntu package the pidfile, setuid and setgid options are handled by either the systemd service or the init script at /etc/init.d/prosody.
When loaded, prosody will handle SIGTERM and SIGINT by initiating a graceful shutdown. Also, SIGHUP will cause it to reload the config file.
Usage
= {
modules_enabled -- Other modules
"posix"; -- Enable mod_posix
}
Configuration
Option | Default | Notes |
---|---|---|
daemonize | true | Whether to daemonize Prosody or not. DEPRECATED since 0.12, use command line flags -D or -F instead. |
run_as_root | false | If Prosody is run as the root user it will exit unless this option is set to true, use with caution |
pidfile | nil | File to write pid in |
umask | "027" | The bitmask set on files created by Prosody |
Example
= {
modules_enabled -- Other modules
"posix"; -- Enable mod_posix
}
= true -- Are you crazy? Prosody doesn't need root access!
run_as_root = false
daemonize = "/tmp/prosody.pid"
pidfile = "027" umask