diff options
author | Holger Weiss <holger@zedat.fu-berlin.de> | 2021-01-06 00:20:12 +0100 |
---|---|---|
committer | Holger Weiss <holger@zedat.fu-berlin.de> | 2021-01-06 00:20:12 +0100 |
commit | 6f026ca26d4015f62d0d5ed639e79d320ece43a1 (patch) | |
tree | 3aff341abdc3ab6e30452e095d21387c98b29927 /ejabberd.service.template | |
parent | XEP-0033 (#3467) (diff) |
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.
Diffstat (limited to 'ejabberd.service.template')
-rw-r--r-- | ejabberd.service.template | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/ejabberd.service.template b/ejabberd.service.template index 526abe360..df205dfcf 100644 --- a/ejabberd.service.template +++ b/ejabberd.service.template @@ -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 |