aboutsummaryrefslogtreecommitdiff
path: root/ejabberd.service.template
diff options
context:
space:
mode:
authorAndreas Oberritter <obi@saftware.de>2020-11-19 20:43:51 +0100
committerAndreas Oberritter <obi@saftware.de>2020-11-19 20:43:51 +0100
commit5c6ffaafd686e1448e2a7e92f70f8001e244bcfe (patch)
treed7b93d93bcd5cd01530280bccf5e022afe257631 /ejabberd.service.template
parentProvide name when pushing new roster item in shared roster group (#3427) (diff)
Let systemd start ejabberd in foreground
Daemons started by systemd shouldn't fork into the background if possible, because if multiple forked processes exist, systemd has a hard time determining the main process ID. In a memory constrained environment, the OOM killer may cause ejabberd to exit without any trace. Because epmd keeps running, systemd wouldn't notice the error condition, and as a result it won't restart the server. With ejabberd running in foreground, systemd is able to obtain the correct exit code (137 in this case, instead of 0) and schedules a restart. The administrator can then see what happend by looking at systemctl status ejabberd.
Diffstat (limited to 'ejabberd.service.template')
-rw-r--r--ejabberd.service.template3
1 files changed, 1 insertions, 2 deletions
diff --git a/ejabberd.service.template b/ejabberd.service.template
index d32353b41..526abe360 100644
--- a/ejabberd.service.template
+++ b/ejabberd.service.template
@@ -3,13 +3,12 @@ Description=XMPP Server
After=network.target
[Service]
-Type=forking
User=ejabberd
Group=ejabberd
LimitNOFILE=65536
Restart=on-failure
RestartSec=5
-ExecStart=/bin/sh -c '@ctlscriptpath@/ejabberdctl start && @ctlscriptpath@/ejabberdctl started'
+ExecStart=@ctlscriptpath@/ejabberdctl foreground
ExecStop=/bin/sh -c '@ctlscriptpath@/ejabberdctl stop && @ctlscriptpath@/ejabberdctl stopped'
ExecReload=@ctlscriptpath@/ejabberdctl reload_config
PrivateDevices=true