From 737562c6ab9d800f880f0e7a9be43ac9508e1af8 Mon Sep 17 00:00:00 2001 From: rbalocca Date: Fri, 26 Sep 2008 16:19:36 -0700 Subject: Fix for http://bugzilla.vyatta.com/show_bug.cgi?id=3680 (floppy config not loaded) --- etc/init.d/vyatta-ofr | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'etc/init.d') diff --git a/etc/init.d/vyatta-ofr b/etc/init.d/vyatta-ofr index 8ff02ab..87e961f 100755 --- a/etc/init.d/vyatta-ofr +++ b/etc/init.d/vyatta-ofr @@ -12,7 +12,7 @@ # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation. -# +# # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU @@ -66,6 +66,22 @@ have_rl_system () { # if necessary, provide initial config init_bootfile () { + # try floppy + # if we do not discover an fd device, try loading the floppy module + grep -q fd /proc/devices || modprobe -q floppy 2>/dev/null + grep -q ext2 /proc/filesystems || modprobe -q ext2 2>/dev/null + grep -q vfat /proc/filesystems || modprobe -q vfat 2>/dev/null + if [ ! -d /media/floppy/config ] && grep -q fd /proc/devices + then + mkdir -p /media/floppy 2>/dev/null + mount /dev/fd0 /media/floppy -o sync 2>/dev/null || + mount -t ext2 /dev/fd0 /media/floppy -o sync 2>/dev/null || + mount -t vfat /dev/fd0 /media/floppy 2>/dev/null + fi + + [ -d /media/floppy/config ] && + mount -o bind /media/floppy/config /opt/vyatta/etc/config + if [ -f $BOOTFILE ] && grep -q '/\*XORP Configuration File, v1.0\*/' \ $BOOTFILE >&/dev/null; then CURTIME=$(date +%F-%H%M%S) @@ -78,7 +94,7 @@ init_bootfile () { $vyatta_sbindir/vyatta_current_conf_ver.pl > $BOOTFILE fi fi - chgrp ${GROUP} $BOOTFILE + chgrp ${GROUP} $BOOTFILE chmod 660 $BOOTFILE ## remove the unnecessary and potentially conflicting ## config-directory statement (i.e. /mnt/floppy vs. /media/floppy -- cgit v1.2.3 From 01491ebb315529124dea2d29f4b72507aa48f9ad Mon Sep 17 00:00:00 2001 From: rbalocca Date: Fri, 26 Sep 2008 16:46:05 -0700 Subject: Simplify the code --- etc/init.d/vyatta-ofr | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'etc/init.d') diff --git a/etc/init.d/vyatta-ofr b/etc/init.d/vyatta-ofr index 87e961f..200ab0b 100755 --- a/etc/init.d/vyatta-ofr +++ b/etc/init.d/vyatta-ofr @@ -73,11 +73,11 @@ init_bootfile () { grep -q vfat /proc/filesystems || modprobe -q vfat 2>/dev/null if [ ! -d /media/floppy/config ] && grep -q fd /proc/devices then - mkdir -p /media/floppy 2>/dev/null - mount /dev/fd0 /media/floppy -o sync 2>/dev/null || - mount -t ext2 /dev/fd0 /media/floppy -o sync 2>/dev/null || - mount -t vfat /dev/fd0 /media/floppy 2>/dev/null - fi + mkdir -p /media/floppy + mount /dev/fd0 /media/floppy -o sync || + mount -t ext2 /dev/fd0 /media/floppy -o sync || + mount -t vfat /dev/fd0 /media/floppy + fi 2>/dev/null [ -d /media/floppy/config ] && mount -o bind /media/floppy/config /opt/vyatta/etc/config -- cgit v1.2.3 From 0a31f85bd2b63af24aa6fecd08a8c75ac45f4535 Mon Sep 17 00:00:00 2001 From: rbalocca Date: Tue, 7 Oct 2008 15:33:47 -0700 Subject: Fix for bug http://bugzilla.vyatta.com/show_bug.cgi?id=2138 --- etc/init.d/vyatta-ofr | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'etc/init.d') diff --git a/etc/init.d/vyatta-ofr b/etc/init.d/vyatta-ofr index 200ab0b..87b3cf9 100755 --- a/etc/init.d/vyatta-ofr +++ b/etc/init.d/vyatta-ofr @@ -126,7 +126,7 @@ start () chgrp ${GROUP} ${vyatta_configdir} log_action_end_msg $? init_bootfile - log_daemon_msg "Starting Vyatta Router" + log_daemon_msg "Starting Vyatta router" migrate_bootfile for s in ${subinit[@]} ; do log_progress_msg $s @@ -141,7 +141,7 @@ start () stop() { local -i status=0 - log_daemon_msg "Stopping Vyatta Router" + log_daemon_msg "Stopping Vyatta router" for ((i=${#sub_inits[@]} - 1; i >= 0; i--)) ; do s=${subinit[$i]} log_progress_msg $s -- cgit v1.2.3 From 3e6a15a97881f82bc615eea5075902b038cca4dc Mon Sep 17 00:00:00 2001 From: Bob Gilligan Date: Fri, 17 Oct 2008 16:19:46 -0700 Subject: Bugfix: 3655 Unload unused RAID modules. --- etc/init.d/vyatta-ofr | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'etc/init.d') diff --git a/etc/init.d/vyatta-ofr b/etc/init.d/vyatta-ofr index 87b3cf9..75a03b4 100755 --- a/etc/init.d/vyatta-ofr +++ b/etc/init.d/vyatta-ofr @@ -119,6 +119,19 @@ load_bootfile () fi } + +# Unload the RAID modules that we are not using. It is safe to try to +# unload all of the RAID modules. The kernel will refuse to unload any +# that we are actually using. +# +cleanup_raid() +{ + MD_MODULES='linear multipath raid0 raid1 raid456 raid5 raid6 raid10' + rmmod $MD_MODULES > /tmp/vyatta_raid_cleanup_log 2>&1 +} + + + start () { log_action_begin_msg "Mounting Vyatta Config" @@ -133,6 +146,7 @@ start () ${vyatta_sbindir}/${s}.init start || (log_end_msg $? && return) done load_bootfile + cleanup_raid chmod g-w,o-w / log_end_msg $? -- cgit v1.2.3