as the patch name says ... systemd gives us a hook to run stuff before
the service is started, we can use that to test if the config is valid.
that's something that my old init script also did.
with kind regards
darix
--
openSUSE - SUSE Linux is my linux
openSUSE is good for you
www.opensuse.org
>From b940a258a735cdfd330a5d45c8f0e38be6a80534 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Kristoffer=20Gr=C3=B6nlund?= <[email protected]>
Date: Thu, 9 Oct 2014 16:51:29 +0200
Subject: [PATCH] systemd: Check configuration before start
Adds a configuration check before starting the haproxy service.
---
contrib/systemd/haproxy.service.in | 1 +
1 file changed, 1 insertion(+)
diff --git a/contrib/systemd/haproxy.service.in b/contrib/systemd/haproxy.service.in
index 0bc5420..85937e4 100644
--- a/contrib/systemd/haproxy.service.in
+++ b/contrib/systemd/haproxy.service.in
@@ -3,6 +3,7 @@ Description=HAProxy Load Balancer
After=network.target
[Service]
+ExecStartPre=@SBINDIR@/haproxy -f /etc/haproxy/haproxy.cfg -c -q
ExecStart=@SBINDIR@/haproxy-systemd-wrapper -f /etc/haproxy/haproxy.cfg -p /run/haproxy.pid
ExecReload=/bin/kill -USR2 $MAINPID
KillMode=mixed
--
1.8.4.5