summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBertrand Jacquin <bertrand@jacquin.bzh>2016-12-13 00:43:48 +0000
committerRobin H. Johnson <robbat2@gentoo.org>2017-05-22 11:43:39 -0700
commitdc8d1598df949105b59ad6d7fda54cc67dbb24e9 (patch)
tree4a4eb6008b5a063b57ecd68c71165f2e2edfcafd /net-proxy
parentnet-ftp/ncftp-3.2.6-r0: add alpha keyword (diff)
downloadgentoo-dc8d1598df949105b59ad6d7fda54cc67dbb24e9.tar.gz
gentoo-dc8d1598df949105b59ad6d7fda54cc67dbb24e9.tar.bz2
gentoo-dc8d1598df949105b59ad6d7fda54cc67dbb24e9.zip
net-proxy/haproxy: Handle stopping multiple proc
When haproxy is configured to use more than 1 proc, it creates a PID file listing all PID, with 1 PID per line. Since start-stop-daemon only handle 1 PID per pidfile, we need to had some magic in the init script in order to stop every process haproxy previously started. See: https://bugs.gentoo.org/show_bug.cgi?id=584410 Package-Manager: portage-2.3.0 (cherry picked from commit 551acd9853212fd0debf4563312af88908b7b497) Signed-off-by: Robin H. Johnson <robbat2@gentoo.org> Fixes: https://github.com/gentoo/gentoo/pull/3104/
Diffstat (limited to 'net-proxy')
-rw-r--r--net-proxy/haproxy/files/haproxy.initd-r311
1 files changed, 11 insertions, 0 deletions
diff --git a/net-proxy/haproxy/files/haproxy.initd-r3 b/net-proxy/haproxy/files/haproxy.initd-r3
index 2ad38fc9ebcc..abba9f865345 100644
--- a/net-proxy/haproxy/files/haproxy.initd-r3
+++ b/net-proxy/haproxy/files/haproxy.initd-r3
@@ -60,6 +60,17 @@ stop_pre() {
fi
}
+stop() {
+ local _t _pid
+
+ _t="$(mktemp)"
+ for _pid in $(cat ${pidfile}) ; do
+ echo "${_pid}" > "${_t}"
+ pidfile="${_t}" openrc_default_stop
+ done
+ rm -f "${_t}"
+}
+
reload() {
checkconfig || { eerror "Reloading failed, please fix your config(s) first"; return 1; }