From c7d77ce9bf54597162016ba45f633d991b45b459 Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Fri, 21 Oct 2022 15:50:06 +0200 Subject: [PATCH] net/haproxy: migrate to NAME_setup use, refs 4e01cb2333acd997b01e6a10a9c447b1ccf520dc NAME_setup is mostly being used during system startup. However, there are still cases where setup.sh is manually called to ensure that certain operations like syntax check are working properly. --- .../OPNsense/HAProxy/Api/ServiceController.php | 2 -- .../opnsense/service/conf/actions.d/actions_haproxy.conf | 8 +------- .../opnsense/service/templates/OPNsense/HAProxy/rc.conf.d | 2 +- 3 files changed, 2 insertions(+), 10 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 524597aef..0632cef86 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 @@ -56,8 +56,6 @@ class ServiceController extends ApiMutableServiceControllerBase $backend = new Backend(); // first generate template based on current configuration $backend->configdRun('template reload OPNsense/HAProxy'); - // now export all the required files (or syntax check will fail) - $backend->configdRun("haproxy setup"); // finally run the syntax check $response = $backend->configdRun("haproxy configtest"); return array("result" => $response); 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 a9f3c5b25..9ca6d13dd 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 @@ -1,9 +1,3 @@ -[setup] -command:/usr/local/opnsense/scripts/OPNsense/HAProxy/setup.sh -parameters: -type:script_output -message:setup haproxy service requirements - [start] command:/usr/local/opnsense/scripts/OPNsense/HAProxy/setup.sh deploy; /usr/local/opnsense/scripts/OPNsense/HAProxy/rc-wrapper.sh start parameters: @@ -31,7 +25,7 @@ description:Reload HAProxy service message:reloading haproxy [configtest] -command:/usr/local/sbin/haproxy -c -f /usr/local/etc/haproxy.conf.staging 2>&1 || exit 0 +command:/usr/local/opnsense/scripts/OPNsense/HAProxy/setup.sh; /usr/local/sbin/haproxy -c -f /usr/local/etc/haproxy.conf.staging 2>&1 || exit 0 parameters: type:script_output message:testing haproxy configuration diff --git a/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/rc.conf.d b/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/rc.conf.d index fdb9bcf37..2e2090670 100644 --- a/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/rc.conf.d +++ b/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/rc.conf.d @@ -1,6 +1,6 @@ {% if helpers.exists('OPNsense.HAProxy.general.enabled') and OPNsense.HAProxy.general.enabled|default("0") == "1" %} haproxy_enable=YES -#haproxy_setup="/usr/local/opnsense/scripts/OPNsense/HAProxy/setup.sh" +haproxy_setup="/usr/local/opnsense/scripts/OPNsense/HAProxy/setup.sh" haproxy_pidfile="/var/run/haproxy.pid" haproxy_config="/usr/local/etc/haproxy.conf" {% if helpers.exists('OPNsense.HAProxy.general.storeOcsp') and OPNsense.HAProxy.general.storeOcsp|default("0") == "1" %}