]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MEDIUM: add systemd service
authorMarc-Antoine Perennou <Marc-Antoine@Perennou.com>
Wed, 13 Feb 2013 08:28:50 +0000 (09:28 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 13 Feb 2013 09:47:59 +0000 (10:47 +0100)
Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
.gitignore
contrib/systemd/Makefile [new file with mode: 0644]
contrib/systemd/haproxy.service.in [new file with mode: 0644]

index 5e6f556c01c48f901ba674d98f94900921f60e59..ec1545a7a3df31ebb184c9d2557a185ad7d703e7 100644 (file)
@@ -16,3 +16,4 @@ haproxy-*
 make-*
 dlmalloc.c
 00*.patch
+*.service
diff --git a/contrib/systemd/Makefile b/contrib/systemd/Makefile
new file mode 100644 (file)
index 0000000..e542c23
--- /dev/null
@@ -0,0 +1,8 @@
+PREFIX = /usr/local
+SBINDIR = $(PREFIX)/sbin
+
+haproxy.service: haproxy.service.in
+       sed -e 's:@SBINDIR@:'$(strip $(SBINDIR))':' $< > $@
+
+clean:
+       rm -f haproxy.service
diff --git a/contrib/systemd/haproxy.service.in b/contrib/systemd/haproxy.service.in
new file mode 100644 (file)
index 0000000..1a3d2c0
--- /dev/null
@@ -0,0 +1,11 @@
+[Unit]
+Description=HAProxy Load Balancer
+After=network.target
+
+[Service]
+ExecStart=@SBINDIR@/haproxy-systemd-wrapper -f /etc/haproxy/haproxy.cfg -p /run/haproxy.pid
+ExecReload=/bin/kill -USR2 $MAINPID
+Restart=always
+
+[Install]
+WantedBy=multi-user.target