Fix stop action to stop correctly multi-process haproxy instance.
PR: 197024 Submitted by: ard_1@mail.ru
This commit is contained in:
parent
bfeea3016b
commit
03b4e917e1
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=378727
@ -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"
|
||||
|
Loading…
Reference in New Issue
Block a user