net/haproxy: s/reconfigure/reload

There is something strange here, the $force_reload is unused and
after stop we don't check the service status so 'running' is still
true and it tries to reload instead.

Best time to refactor into a mutable service controller?!

PR: https://github.com/opnsense/plugins/issues/454
CC: @fraenki
This commit is contained in:
Franco Fichtner 2018-01-01 12:58:38 +01:00
parent a91c6e3f92
commit c458c3c745
3 changed files with 5 additions and 3 deletions

View file

@ -145,7 +145,7 @@ class ServiceController extends ApiControllerBase
// (res)start daemon
if ($mdlProxy->general->enabled->__toString() == 1) {
if ($runStatus['status'] == "running" && !$force_restart) {
$backend->configdRun("haproxy reconfigure");
$backend->configdRun("haproxy reload");
} else {
$this->startAction();
}

View file

@ -4,6 +4,8 @@ if [ -f /etc/rc.conf.d/haproxy ]; then
. /etc/rc.conf.d/haproxy
fi
rcprefix=
case "$1" in
stop|restart)
if [ "${haproxy_hardstop}" == "YES" ]; then

View file

@ -22,11 +22,11 @@ parameters:
type:script
message:restarting haproxy
[reconfigure]
[reload]
command:/usr/local/opnsense/scripts/OPNsense/HAProxy/setup.sh; /usr/local/opnsense/scripts/OPNsense/HAProxy/rc-wrapper.sh reload
parameters:
type:script
message:reconfiguring haproxy
message:reloading haproxy
[configtest]
command:/usr/local/etc/rc.d/haproxy configtest 2>&1 || exit 0