mirror of
https://github.com/processone/ejabberd.git
synced 2024-11-22 16:20:52 +01:00
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.
This commit is contained in:
parent
3581d90d9d
commit
5c6ffaafd6
@ -3,13 +3,12 @@ Description=XMPP Server
|
|||||||
After=network.target
|
After=network.target
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=forking
|
|
||||||
User=ejabberd
|
User=ejabberd
|
||||||
Group=ejabberd
|
Group=ejabberd
|
||||||
LimitNOFILE=65536
|
LimitNOFILE=65536
|
||||||
Restart=on-failure
|
Restart=on-failure
|
||||||
RestartSec=5
|
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'
|
ExecStop=/bin/sh -c '@ctlscriptpath@/ejabberdctl stop && @ctlscriptpath@/ejabberdctl stopped'
|
||||||
ExecReload=@ctlscriptpath@/ejabberdctl reload_config
|
ExecReload=@ctlscriptpath@/ejabberdctl reload_config
|
||||||
PrivateDevices=true
|
PrivateDevices=true
|
||||||
|
Loading…
Reference in New Issue
Block a user