From fa76ad87dad7142d468a4c2fd11b0fca6602bb55 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Wed, 3 Feb 2010 17:01:34 -0800 Subject: Allow fine grain disabling of vyatta during boot Can skip system config or firewall portions individually. Can use: novyatta-configure novyatta-migrate novyatta-rl-system ... --- etc/init.d/vyatta-router | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/etc/init.d/vyatta-router b/etc/init.d/vyatta-router index 514e631..0a14437 100755 --- a/etc/init.d/vyatta-router +++ b/etc/init.d/vyatta-router @@ -30,9 +30,6 @@ . /lib/lsb/init-functions -# Allow disabling vyatta configuration on boot -grep -q novyatta /proc/cmdline && exit 0 - : ${vyatta_env:=/etc/default/vyatta} source $vyatta_env @@ -62,9 +59,13 @@ else fi fi +# check if bootup of this portion is disabled +disabled () { + grep -q -w novyatta-$1 /proc/cmdline +} + # if necessary, provide initial config init_bootfile () { - if [ -b /dev/fd0 ] && [ ! -d /media/floppy/config ] then [ -d /media/floppy ] || mkdir -p /media/floppy @@ -152,14 +153,20 @@ start () mount -o nosuid,nodev,mode=775 -t tmpfs none ${vyatta_configdir} && \ chgrp ${GROUP} ${vyatta_configdir} log_action_end_msg $? - init_bootfile + + disabled bootfile || init_bootfile + log_daemon_msg "Starting Vyatta router" - migrate_bootfile + disabled migrate || migrate_bootfile for s in ${subinit[@]} ; do - log_progress_msg $s - ${vyatta_sbindir}/${s}.init start || (log_end_msg $? && return) + if ! disabled $s; then + log_progress_msg $s + ${vyatta_sbindir}/${s}.init start || (log_end_msg $? && return) + fi done - load_bootfile + + disabled configure || load_bootfile + load_acpi_cpufreq cleanup_raid chmod g-w,o-w / -- cgit v1.2.3