mirror of
https://github.com/opnsense/plugins.git
synced 2026-06-04 14:26:13 -04:00
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:
parent
a91c6e3f92
commit
c458c3c745
3 changed files with 5 additions and 3 deletions
|
|
@ -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();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue