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"