From c458c3c7457bea8a0c014ee6b7a2356e836d35b1 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Mon, 1 Jan 2018 12:58:38 +0100 Subject: [PATCH] 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 --- .../controllers/OPNsense/HAProxy/Api/ServiceController.php | 2 +- .../src/opnsense/scripts/OPNsense/HAProxy/rc-wrapper.sh | 2 ++ .../src/opnsense/service/conf/actions.d/actions_haproxy.conf | 4 ++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/Api/ServiceController.php b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/Api/ServiceController.php index b6b1e7542..e5f7b3f34 100644 --- a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/Api/ServiceController.php +++ b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/Api/ServiceController.php @@ -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(); } diff --git a/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/rc-wrapper.sh b/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/rc-wrapper.sh index 163448ab3..28de9c9f8 100755 --- a/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/rc-wrapper.sh +++ b/net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/rc-wrapper.sh @@ -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 diff --git a/net/haproxy/src/opnsense/service/conf/actions.d/actions_haproxy.conf b/net/haproxy/src/opnsense/service/conf/actions.d/actions_haproxy.conf index 1ee61b638..88399e3a3 100644 --- a/net/haproxy/src/opnsense/service/conf/actions.d/actions_haproxy.conf +++ b/net/haproxy/src/opnsense/service/conf/actions.d/actions_haproxy.conf @@ -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