--- net/haproxy-devel/files/haproxy.in.orig 2015-03-12 15:33:31.000000000 +0100 +++ net/haproxy-devel/files/haproxy.in 2017-08-14 23:17:41.833162000 +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() {