aboutsummaryrefslogtreecommitdiffstats
path: root/net/haproxy
diff options
context:
space:
mode:
authordemon <demon@FreeBSD.org>2015-02-09 21:06:11 +0800
committerdemon <demon@FreeBSD.org>2015-02-09 21:06:11 +0800
commit18ec39c80dfd8b2922223c7f4ba3bb04e94a8833 (patch)
tree9d97ac4e3a8a56c15da3342c05e5de0e72454803 /net/haproxy
parent2b52d03a33828831285c0a54fcdb1520b4ae6d34 (diff)
downloadfreebsd-ports-gnome-18ec39c80dfd8b2922223c7f4ba3bb04e94a8833.tar.gz
freebsd-ports-gnome-18ec39c80dfd8b2922223c7f4ba3bb04e94a8833.tar.zst
freebsd-ports-gnome-18ec39c80dfd8b2922223c7f4ba3bb04e94a8833.zip
Fix stop action to stop correctly multi-process haproxy instance.
PR: 197024 Submitted by: ard_1@mail.ru
Diffstat (limited to 'net/haproxy')
-rw-r--r--net/haproxy/files/haproxy.in14
1 files changed, 14 insertions, 0 deletions
diff --git a/net/haproxy/files/haproxy.in b/net/haproxy/files/haproxy.in
index 48a5ae7604c6..751b3067d083 100644
--- a/net/haproxy/files/haproxy.in
+++ b/net/haproxy/files/haproxy.in
@@ -31,6 +31,7 @@ rcvar=haproxy_enable
command="%%PREFIX%%/sbin/haproxy"
extra_commands="reload configtest"
reload_cmd="haproxy_reload"
+stop_cmd="haproxy_stop"
: ${haproxy_enable:="NO"}
: ${haproxy_config:="%%PREFIX%%/etc/${name}.conf"}
@@ -100,4 +101,17 @@ haproxy_reload()
fi
}
+haproxy_stop()
+{
+ rc_pid=$(check_pidfile ${pidfile} ${command})
+ if [ $rc_pid ]; then
+ rc_pid=$(cat ${pidfile})
+ kill -$sig_stop $rc_pid
+ wait_for_pids $rc_pid
+ else
+ _run_rc_notrunning
+ return 1
+ fi
+}
+
run_rc_command "$1"