mirror of
https://github.com/processone/ejabberd
synced 2025-10-03 09:49:18 +02:00
Integrate nicely with systemd
Support systemd's watchdog feature and enable it by default in the unit file, so that ejabberd is auto-restarted if the VM becomes unresponsive. Also, set the systemd startup type to 'notify', so that startup of followup units is delayed until ejabberd signals readiness. While at it, also notify systemd of configuration reload and shutdown states. Note: "NotifyAccess=all" is required as long as "ejabberdctl foreground" runs the VM as a new child process, rather than "exec"ing it. This way, systemd views the ejabberdctl process itself as the main service process, and would discard notifications from other processes by default.
This commit is contained in:
parent
4132aedb9c
commit
6f026ca26d
5 changed files with 227 additions and 22 deletions
|
@ -3,14 +3,17 @@ Description=XMPP Server
|
|||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=notify
|
||||
User=ejabberd
|
||||
Group=ejabberd
|
||||
LimitNOFILE=65536
|
||||
Restart=on-failure
|
||||
RestartSec=5
|
||||
WatchdogSec=30
|
||||
ExecStart=@ctlscriptpath@/ejabberdctl foreground
|
||||
ExecStop=/bin/sh -c '@ctlscriptpath@/ejabberdctl stop && @ctlscriptpath@/ejabberdctl stopped'
|
||||
ExecReload=@ctlscriptpath@/ejabberdctl reload_config
|
||||
NotifyAccess=all
|
||||
PrivateDevices=true
|
||||
TimeoutSec=300
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue