diff options
author | demon <demon@FreeBSD.org> | 2015-02-09 21:06:11 +0800 |
---|---|---|
committer | demon <demon@FreeBSD.org> | 2015-02-09 21:06:11 +0800 |
commit | 18ec39c80dfd8b2922223c7f4ba3bb04e94a8833 (patch) | |
tree | 9d97ac4e3a8a56c15da3342c05e5de0e72454803 /net/haproxy | |
parent | 2b52d03a33828831285c0a54fcdb1520b4ae6d34 (diff) | |
download | freebsd-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.in | 14 |
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" |