diff options
author | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2010-02-03 17:01:34 -0800 |
---|---|---|
committer | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2010-02-03 17:31:37 -0800 |
commit | fa76ad87dad7142d468a4c2fd11b0fca6602bb55 (patch) | |
tree | 19c2513cefd1a66a673755b62974bff2628d86e3 /etc/init.d | |
parent | d02c67ed74c9bb3ccdcc8eb5291ee73077d2b8ee (diff) | |
download | vyatta-cfg-fa76ad87dad7142d468a4c2fd11b0fca6602bb55.tar.gz vyatta-cfg-fa76ad87dad7142d468a4c2fd11b0fca6602bb55.zip |
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
...
Diffstat (limited to 'etc/init.d')
-rwxr-xr-x | etc/init.d/vyatta-router | 25 |
1 files 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 / |