From 88c70beb5a24cf200a32c70a8a95865c8e97efb6 Mon Sep 17 00:00:00 2001 From: Marc-Antoine Perennou Date: Fri, 22 Nov 2013 08:28:03 +0100 Subject: [PATCH 01/15] MEDIUM: add systemd service --- .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 5d9576af102e..83d84083ca3e 100644 --- a/.gitignore +++ b/.gitignore @@ -15,3 +15,4 @@ haproxy-* make-* dlmalloc.c 00*.patch +*.service diff --git a/contrib/systemd/Makefile b/contrib/systemd/Makefile new file mode 100644 index 000000000000..e542c2387c79 --- /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 000000000000..1a3d2c050f49 --- /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 -- 1.8.4.5