mirror of
https://github.com/opnsense/plugins.git
synced 2026-06-14 20:13:19 -04:00
net/haproxy: use rc wrapper script to set hard/graceful mode, refs #195
This commit is contained in:
parent
472d5d601e
commit
2f875dc2cc
4 changed files with 20 additions and 16 deletions
|
|
@ -1,7 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
. /etc/rc.conf.d/haproxy
|
||||
|
||||
if [ "x${haproxy_hardstop}" == "xYES" ]; then
|
||||
/usr/local/etc/rc.d/haproxy configtest && /usr/local/etc/rc.d/haproxy hardstop
|
||||
fi
|
||||
|
|
@ -1,7 +1,3 @@
|
|||
#!/bin/sh
|
||||
|
||||
. /etc/rc.conf.d/haproxy
|
||||
|
||||
if [ "x${haproxy_hardstop}" == "xYES" ]; then
|
||||
/usr/local/etc/rc.d/haproxy hardstop
|
||||
fi
|
||||
/usr/local/opnsense/scripts/OPNsense/HAProxy/rc-wrapper.sh stop
|
||||
|
|
|
|||
15
net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/rc-wrapper.sh
Executable file
15
net/haproxy/src/opnsense/scripts/OPNsense/HAProxy/rc-wrapper.sh
Executable file
|
|
@ -0,0 +1,15 @@
|
|||
#!/bin/sh
|
||||
|
||||
if [ -f /etc/rc.conf.d/haproxy ]; then
|
||||
. /etc/rc.conf.d/haproxy
|
||||
fi
|
||||
|
||||
case "$1" in
|
||||
stop|restart)
|
||||
if [ "${haproxy_hardstop}" == "YES" ]; then
|
||||
rcprefix="hard"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
/usr/local/etc/rc.d/haproxy ${rcprefix}${1}
|
||||
|
|
@ -5,25 +5,25 @@ type:script_output
|
|||
message:setup haproxy service requirements
|
||||
|
||||
[start]
|
||||
command:/usr/local/opnsense/scripts/OPNsense/HAProxy/setup.sh; /usr/local/etc/rc.d/haproxy start
|
||||
command:/usr/local/opnsense/scripts/OPNsense/HAProxy/setup.sh; /usr/local/opnsense/scripts/OPNsense/HAProxy/rc-wrapper.sh start
|
||||
parameters:
|
||||
type:script
|
||||
message:starting haproxy
|
||||
|
||||
[stop]
|
||||
command:/usr/local/etc/rc.syshook.d/50-haproxy.stop; /usr/local/etc/rc.d/haproxy stop; /usr/bin/killall haproxy; exit 0
|
||||
command:/usr/local/opnsense/scripts/OPNsense/HAProxy/rc-wrapper.sh stop; /usr/bin/killall haproxy; exit 0
|
||||
parameters:
|
||||
type:script
|
||||
message:stopping haproxy
|
||||
|
||||
[restart]
|
||||
command:/usr/local/opnsense/scripts/OPNsense/HAProxy/setup.sh; /usr/local/etc/rc.syshook.d/50-haproxy.restart; /usr/local/etc/rc.d/haproxy restart
|
||||
command:/usr/local/opnsense/scripts/OPNsense/HAProxy/setup.sh; /usr/local/opnsense/scripts/OPNsense/HAProxy/rc-wrapper.sh restart
|
||||
parameters:
|
||||
type:script
|
||||
message:restarting haproxy
|
||||
|
||||
[reconfigure]
|
||||
command:/usr/local/opnsense/scripts/OPNsense/HAProxy/setup.sh; /usr/local/etc/rc.d/haproxy 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
|
||||
|
|
|
|||
Loading…
Reference in a new issue