mirror of
https://github.com/processone/ejabberd.git
synced 2024-12-22 17:28:25 +01:00
6f026ca26d
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.
22 lines
455 B
Plaintext
22 lines
455 B
Plaintext
[Unit]
|
|
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
|
|
|
|
[Install]
|
|
WantedBy=multi-user.target
|