mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-15 09:04:39 +00:00
system: join carp scripts, move to priority 90 like port script
This commit is contained in:
parent
c1573d7063
commit
7ad13cd08e
3
plist
3
plist
@ -127,8 +127,7 @@
|
||||
/usr/local/etc/rc.syshook.d/early/10-configd
|
||||
/usr/local/etc/rc.syshook.d/early/15-templates
|
||||
/usr/local/etc/rc.syshook.d/early/20-backup
|
||||
/usr/local/etc/rc.syshook.d/early/98-carp_maintenance
|
||||
/usr/local/etc/rc.syshook.d/early/99-carp_service_status
|
||||
/usr/local/etc/rc.syshook.d/early/90-carp
|
||||
/usr/local/etc/rc.syshook.d/monitor/10-dpinger
|
||||
/usr/local/etc/rc.syshook.d/start/10-newwanip
|
||||
/usr/local/etc/rc.syshook.d/start/20-freebsd
|
||||
|
||||
17
src/etc/rc.syshook.d/early/90-carp
Executable file
17
src/etc/rc.syshook.d/early/90-carp
Executable file
@ -0,0 +1,17 @@
|
||||
#!/bin/sh
|
||||
|
||||
# when virtualip_carp_maintenancemode is set, make sure we startup in demoted state
|
||||
if [ -f /conf/config.xml ]; then
|
||||
IS_MNT=$(grep -c virtualip_carp_maintenancemode /conf/config.xml)
|
||||
IS_DEMOTED=$(/sbin/sysctl net.inet.carp.demotion | /usr/bin/awk '{print $2;}')
|
||||
if [ ${IS_MNT} -gt 0 ] && [ ${IS_DEMOTED} -eq -0 ]; then
|
||||
/sbin/sysctl net.inet.carp.demotion=240
|
||||
fi
|
||||
fi
|
||||
|
||||
# Trigger carp service status event. When any of the checks in
|
||||
# /usr/local/etc/rc.carp_service_status.d/ fail, net.inet.carp.demotion
|
||||
# is updated to prevent switching to master too early
|
||||
|
||||
echo -n "CARP event system: "
|
||||
configctl interface update carp service_status
|
||||
@ -1,10 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
# when virtualip_carp_maintenancemode is set, make sure we startup in demoted state
|
||||
if [ -f /conf/config.xml ]; then
|
||||
IS_MNT=`grep -c virtualip_carp_maintenancemode /conf/config.xml`
|
||||
IS_DEMOTED=`/sbin/sysctl net.inet.carp.demotion | /usr/bin/awk '{print $2;}'`
|
||||
if [ $IS_MNT -gt 0 ] && [ $IS_DEMOTED -eq -0 ]; then
|
||||
/sbin/sysctl net.inet.carp.demotion=240
|
||||
fi
|
||||
fi
|
||||
@ -1,7 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Trigger carp service status event.
|
||||
# When any of the checks in /usr/local/etc/rc.carp_service_status.d/ fails, net.inet.carp.demotion is updated
|
||||
# to prevent switching to master too early
|
||||
|
||||
configctl interface update carp service_status
|
||||
Loading…
x
Reference in New Issue
Block a user