From e7e1e67fc707c3a392f1c29e611e68a48fb81d6c Mon Sep 17 00:00:00 2001 From: Vincent Li Date: Mon, 1 Jul 2024 15:22:55 +0000 Subject: [PATCH] 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 --- config/rootfiles/common/keepalived | 1 + config/rootfiles/common/loxilb | 1 + lfs/initscripts | 2 ++ src/initscripts/packages/keepalived | 11 +++++++---- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/config/rootfiles/common/keepalived b/config/rootfiles/common/keepalived index 2fac3b0c2..9f7d349cf 100644 --- a/config/rootfiles/common/keepalived +++ b/config/rootfiles/common/keepalived @@ -39,3 +39,4 @@ usr/sbin/keepalived #usr/share/man/man8/keepalived.8 var/ipfire/backup/addons/includes/keepalived var/ipfire/keepalived +etc/rc.d/rc3.d/S101keepalived diff --git a/config/rootfiles/common/loxilb b/config/rootfiles/common/loxilb index fb7c05444..411657b13 100644 --- a/config/rootfiles/common/loxilb +++ b/config/rootfiles/common/loxilb @@ -4,3 +4,4 @@ opt/loxilb/llb_kern_sock.o opt/loxilb/llb_xdp_main.o opt/loxilb/loxilb_libdp.o usr/bin/loxilb +etc/rc.d/rc3.d/S100loxilb diff --git a/lfs/initscripts b/lfs/initscripts index e078632ab..0059d4775 100644 --- a/lfs/initscripts +++ b/lfs/initscripts @@ -135,6 +135,8 @@ $(TARGET) : ln -sf ../init.d/imspetor /etc/rc.d/rc3.d/S99imspetor ln -sf ../init.d/motion /etc/rc.d/rc3.d/S99motion ln -sf ../init.d/vdradmin /etc/rc.d/rc3.d/S99vdradmin + ln -sf ../init.d/loxilb /etc/rc.d/rc3.d/S100loxilb + ln -sf ../init.d/keepalived /etc/rc.d/rc3.d/S101keepalived ln -sf ../init.d/imspetor /etc/rc.d/rc6.d/K01imspetor ln -sf ../init.d/motion /etc/rc.d/rc6.d/K01motion diff --git a/src/initscripts/packages/keepalived b/src/initscripts/packages/keepalived index 8186b4ff2..37eb3d61a 100644 --- a/src/initscripts/packages/keepalived +++ b/src/initscripts/packages/keepalived @@ -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)