MEDIUM: add systemd service
Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
diff --git a/contrib/systemd/Makefile b/contrib/systemd/Makefile
new file mode 100644
index 0000000..e542c23
--- /dev/null
+++ b/contrib/systemd/Makefile
@@ -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
index 0000000..1a3d2c0
--- /dev/null
+++ b/contrib/systemd/haproxy.service.in
@@ -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