From: Michael Tremer Date: Tue, 30 Oct 2018 17:24:34 +0000 (+0000) Subject: frr: Add initscript X-Git-Tag: v2.21-core125~25^2~8^2~6^2~2 X-Git-Url: http://git.ipfire.org/?p=people%2Fpmueller%2Fipfire-2.x.git;a=commitdiff_plain;h=ebd6fe2b50a4f51a93475fc33f385b5477480a43 frr: Add initscript Signed-off-by: Michael Tremer --- diff --git a/config/rootfiles/packages/frr b/config/rootfiles/packages/frr index 845fea3c43..5db055de69 100644 --- a/config/rootfiles/packages/frr +++ b/config/rootfiles/packages/frr @@ -7,6 +7,7 @@ etc/frr/ripngd.conf.sample etc/frr/staticd.conf.sample etc/frr/vtysh.conf.sample etc/frr/zebra.conf.sample +etc/rc.d/init.d/frr usr/bin/bgp_btoa usr/bin/vtysh #usr/include/frr diff --git a/lfs/frr b/lfs/frr index 756b877290..c90340fed5 100644 --- a/lfs/frr +++ b/lfs/frr @@ -101,6 +101,10 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) --disable-ripngd cd $(DIR_APP) && make $(MAKETUNING) cd $(DIR_APP) && make install + + # Install initscript + $(call INSTALL_INITSCRIPT,frr) + @rm -rf $(DIR_APP) @$(POSTBUILD) diff --git a/src/initscripts/packages/frr b/src/initscripts/packages/frr new file mode 100755 index 0000000000..9ebb5f85b4 --- /dev/null +++ b/src/initscripts/packages/frr @@ -0,0 +1,54 @@ +#!/bin/sh +######################################################################## +# Begin $rc_base/init.d/frr +# +# Description : FRRouting Suite +# +######################################################################## + +. /etc/sysconfig/rc +. ${rc_functions} + +DAEMONS="zebra bgpd ospfd staticd" + +case "${1}" in + start) + for daemon in ${DAEMONS}; do + if [ -f "/etc/frr/${daemon}.conf" ]; then + boot_mesg "Starting FRRouting ${daemon}..." + loadproc "/usr/sbin/${daemon}" --daemon + fi + done + ;; + + stop) + for daemon in ${DAEMONS}; do + boot_mesg "Stopping FRRouting ${daemon}..." + killproc "/usr/sbin/${daemon}" + done + ;; + + reload) + boot_mesg "Reloading FRRouting..." + reloadproc /usr/sbin/frr-reload + ;; + + restart) + ${0} stop + sleep 1 + ${0} start + ;; + + status) + for daemon in ${DAEMONS}; do + statusproc "/usr/sbin/${daemon}" + done + ;; + + *) + echo "Usage: ${0} {start|stop|reload|restart|status}" + exit 1 + ;; +esac + +# End $rc_base/init.d/frr diff --git a/src/paks/frr/install.sh b/src/paks/frr/install.sh index 60d77a0156..7e0222246e 100644 --- a/src/paks/frr/install.sh +++ b/src/paks/frr/install.sh @@ -43,3 +43,10 @@ restore_backup "${NAME}" # Start services start_service "${NAME}" + +# Enable autostart +ln -svf ../init.d/frr /etc/rc.d/rc0.d/K40frr +ln -svf ../init.d/frr /etc/rc.d/rc3.d/S50frr +ln -svf ../init.d/frr /etc/rc.d/rc6.d/K40frr + +exit 0