summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorDmitry Sivachenko <demon@FreeBSD.org>2015-02-09 13:06:11 +0000
committerDmitry Sivachenko <demon@FreeBSD.org>2015-02-09 13:06:11 +0000
commit03b4e917e1a398066fff82cd2a0217d774103128 (patch)
tree9d97ac4e3a8a56c15da3342c05e5de0e72454803 /net
parentUpdate to 0.2.6.2-alpha (diff)
Fix stop action to stop correctly multi-process haproxy instance.
PR: 197024 Submitted by: ard_1@mail.ru
Notes
Notes: svn path=/head/; revision=378727
Diffstat (limited to 'net')
-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"