forked from pool/haproxy
a0959c3526
Backported the systemd-wrapper from upstream and patched it to work on openSUSE. OBS-URL: https://build.opensuse.org/request/show/207942 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/haproxy?expand=0&rev=3
57 lines
1.5 KiB
Diff
57 lines
1.5 KiB
Diff
From 4a190f7d08857fec82fa0c07e29e8754d0ba9794 Mon Sep 17 00:00:00 2001
|
|
From: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
|
|
Date: Fri, 22 Nov 2013 08:28:03 +0100
|
|
Subject: [PATCH 1/5] 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
|
|
|