[sheepdog] [PATCH] use systemd restart ability to monitor sheepdog daemon

Vasiliy Tolstov v.tolstov at selfip.ru
Fri Dec 5 13:28:58 CET 2014


From: Vladislav Gorbunov <vadikgo at gmail.com>

Restart sheepdog if the service process exits due to an uncaught signal
not specified as a clean exit status.

Signed-off-by: Vladislav Gorbunov <vadikgo at gmail.com>
Reviewed-by: Vasiliy Tolstov <v.tolstov at selfip.ru>
---
 script/sheepdog.service.in | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/script/sheepdog.service.in b/script/sheepdog.service.in
index e7600cc..1da6f37 100644
--- a/script/sheepdog.service.in
+++ b/script/sheepdog.service.in
@@ -10,6 +10,9 @@ EnvironmentFile=- at SYSCONFDIR@/default/sheepdog
 ExecStart=/bin/sh -c '@SBINDIR@/sheep --pidfile @LOCALSTATEDIR@/run/sheep.pid $(if [ -z "$SHEEP_OPTS" ]; then echo "--cluster local --log dst=syslog --upgrade @LOCALSTATEDIR@/lib/sheepdog"; else echo $SHEEP_OPTS; fi)'
 PIDFile=@LOCALSTATEDIR@/run/sheep.pid
 Type=forking
+Restart=on-abort
+StartLimitInterval=10s
+StartLimitBurst=3
 
 [Install]
 WantedBy=multi-user.target
-- 
2.1.3




More information about the sheepdog mailing list