From 1bdbe54442098ed4c54219de834f22109a4e9868 Mon Sep 17 00:00:00 2001 From: Holger Weiss Date: Thu, 20 Oct 2016 00:27:50 +0200 Subject: [PATCH] Let systemd stop ejabberd gracefully Make sure the "ExecStop" command line blocks until ejabberd is actually stopped. This prevents systemd from killing the ejabberd process(es) immediately. Also, let the "ExecStart" command line block until ejabberd's startup is completed. This makes sure that services which depend on ejabberd aren't started up too early. --- ejabberd.service.template | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ejabberd.service.template b/ejabberd.service.template index 560a93265..a70d2254d 100644 --- a/ejabberd.service.template +++ b/ejabberd.service.template @@ -9,8 +9,8 @@ Group=ejabberd LimitNOFILE=65536 Restart=on-failure RestartSec=5 -ExecStart=@ctlscriptpath@/ejabberdctl start -ExecStop=@ctlscriptpath@/ejabberdctl stop +ExecStart=/bin/sh -c '@ctlscriptpath@/ejabberdctl start && @ctlscriptpath@/ejabberdctl started' +ExecStop=/bin/sh -c '@ctlscriptpath@/ejabberdctl stop && @ctlscriptpath@/ejabberdctl stopped' PrivateDevices=true ProtectSystem=full