From f825580da885b912aba9d0c5417be95d5282d9ef Mon Sep 17 00:00:00 2001 From: Marc-Antoine Perennou Date: Wed, 13 Feb 2013 09:28:50 +0100 Subject: [PATCH] MEDIUM: add systemd service Signed-off-by: Marc-Antoine Perennou --- .gitignore | 1 + contrib/systemd/Makefile | 8 ++++++++ contrib/systemd/haproxy.service.in | 11 +++++++++++ 3 files changed, 20 insertions(+) create mode 100644 contrib/systemd/Makefile create mode 100644 contrib/systemd/haproxy.service.in diff --git a/.gitignore b/.gitignore index 5e6f556c0..ec1545a7a 100644 --- a/.gitignore +++ b/.gitignore @@ -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 index 000000000..e542c2387 --- /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 000000000..1a3d2c050 --- /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