initscripts: start loxilb keepalived after reboot

When loxilb and keepalived are enabled, after BPFire
rebooted, loxilb and keepalived failed to start and
shows as "STOPPED" from UI, this is not expected since
we want to loxilb and keepalived to continue to be enabled
after reboot based on the enabled state of loxilb and
keepalived before reboot.

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
This commit is contained in:
Vincent Li
2024-07-01 15:22:55 +00:00
parent fae6f15fbe
commit e7e1e67fc7
4 changed files with 11 additions and 4 deletions

View File

@@ -23,17 +23,20 @@
. ${rc_functions}
[ -r "/etc/sysconfig/keepalive" ] && . /etc/sysconfig/keepalive
eval $(/usr/local/bin/readhash /var/ipfire/keepalived/runsettings)
case "${1}" in
start)
# Load IPVS module
modprobe ip_vs
# modprobe ip_vs
# Enable connection tracking for IPVS
sysctl -w net.ipv4.vs.conntrack=1 &>/dev/null
# sysctl -w net.ipv4.vs.conntrack=1 &>/dev/null
boot_mesg "Starting keepalive daemon..."
loadproc /usr/sbin/keepalived ${KEEPALIVED_OPTIONS}
if [ "$ENABLE_HA" == "on" ]; then
boot_mesg "Starting keepalive daemon..."
loadproc /usr/sbin/keepalived ${KEEPALIVED_OPTIONS}
fi
;;
stop)