Add 'softreload' command for seamless haproxy reload (-x option).

PR:		230305
Submitted by:	Frank Wall <fw@moov.de>
This commit is contained in:
Dmitry Sivachenko 2018-08-24 19:19:26 +00:00
parent 3df9ce08f0
commit 2c3072cadb
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=477980
2 changed files with 18 additions and 2 deletions

View file

@ -29,16 +29,19 @@
name="haproxy"
rcvar=haproxy_enable
command="%%PREFIX%%/sbin/haproxy"
extra_commands="reload configtest hardstop hardreload"
extra_commands="reload configtest hardstop hardreload softreload"
reload_cmd="haproxy_reload"
hardreload_cmd="haproxy_reload"
hardreload_precmd="def_hardreload_option"
softreload_cmd="haproxy_reload"
softreload_precmd="def_softreload_option"
stop_cmd="haproxy_stop"
hardstop_cmd="haproxy_stop"
hardstop_precmd="def_hardstop_signal"
: ${haproxy_enable:="NO"}
: ${haproxy_config:="%%PREFIX%%/etc/${name}.conf"}
: ${haproxy_socket:="/var/run/${name}/socket"}
pidfile=${haproxy_pidfile:-"/var/run/haproxy.pid"}
def_hardreload_option()
@ -46,6 +49,11 @@ def_hardreload_option()
reload_opt="-st"
}
def_softreload_option()
{
reload_opt="-x ${haproxy_socket} -sf"
}
def_hardstop_signal()
{
sig_stop="TERM"

View file

@ -29,16 +29,19 @@
name="haproxy"
rcvar=haproxy_enable
command="%%PREFIX%%/sbin/haproxy"
extra_commands="reload configtest hardstop hardreload"
extra_commands="reload configtest hardstop hardreload softreload"
reload_cmd="haproxy_reload"
hardreload_cmd="haproxy_reload"
hardreload_precmd="def_hardreload_option"
softreload_cmd="haproxy_reload"
softreload_precmd="def_softreload_option"
stop_cmd="haproxy_stop"
hardstop_cmd="haproxy_stop"
hardstop_precmd="def_hardstop_signal"
: ${haproxy_enable:="NO"}
: ${haproxy_config:="%%PREFIX%%/etc/${name}.conf"}
: ${haproxy_socket:="/var/run/${name}/socket"}
pidfile=${haproxy_pidfile:-"/var/run/haproxy.pid"}
def_hardreload_option()
@ -46,6 +49,11 @@ def_hardreload_option()
reload_opt="-st"
}
def_softreload_option()
{
reload_opt="-x ${haproxy_socket} -sf"
}
def_hardstop_signal()
{
sig_stop="TERM"