system: join carp scripts, move to priority 90 like port script

This commit is contained in:
Franco Fichtner 2020-01-30 20:42:10 +01:00
parent c1573d7063
commit 7ad13cd08e
4 changed files with 18 additions and 19 deletions

3
plist
View File

@ -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

View 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

View File

@ -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

View File

@ -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