--- net/haproxy/files/haproxy.in.orig 2017-08-10 23:45:24.972647000 +0200 +++ net/haproxy/files/haproxy.in 2017-08-14 23:16:06.066260000 +0200 @@ -29,17 +29,21 @@ name="haproxy" rcvar=haproxy_enable command="%%PREFIX%%/sbin/haproxy" -extra_commands="reload configtest" +extra_commands="reload configtest hardstop" reload_cmd="haproxy_reload" stop_cmd="haproxy_stop" +hardstop_cmd="haproxy_stop" +hardstop_precmd="hardstop_pre_check" : ${haproxy_enable:="NO"} : ${haproxy_config:="%%PREFIX%%/etc/${name}.conf"} pidfile=${haproxy_pidfile:-"/var/run/haproxy.pid"} -if [ -z "$rc_force" ]; then - sig_stop="USR1" -fi +hardstop_pre_check() +{ + # setting signal to "TERM" to enable HAProxy's hard stop mode + sig_stop="TERM" +} load_rc_config $name @@ -81,6 +85,8 @@ configtest_cmd="$command -c -f $haproxy_config" start_precmd="$command -q -c -f $haproxy_config" required_files=$haproxy_config +# setting default signal to "USR1" to enable HAProxy's graceful stop mode +sig_stop="${haproxy_sig_stop:-USR1}" haproxy_reload() {