From 543fcf9777958e648acf0cd25027523fc3bcd974 Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Tue, 14 Jan 2003 04:01:59 +0000 Subject: fix raidtab parsing, don't worry about not-in-fstab RAID devices (#71087, #78467, ) --- rc.d/rc.sysinit | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'rc.d/rc.sysinit') diff --git a/rc.d/rc.sysinit b/rc.d/rc.sysinit index c6ef5d90..31c867a6 100755 --- a/rc.d/rc.sysinit +++ b/rc.d/rc.sysinit @@ -420,7 +420,7 @@ if [ -f /etc/raidtab -a -f /proc/mdstat ]; then rc=0 - for i in `grep "^[^*]*raiddev" /etc/raidtab | awk '{print $2}'` + for i in `awk '{if ($1=="raiddev") print $2}' /etc/raidtab` do RAIDDEV=`basename $i` RAIDSTAT=`grep "^$RAIDDEV : active" /proc/mdstat` @@ -432,6 +432,11 @@ if [ -f /etc/raidtab -a -f /proc/mdstat ]; then # fall back to raidadd, raidrun. If that # also fails, then we drop to a shell RESULT=1 + INFSTAB=`LC_ALL=C grep -c "^$i" /etc/fstab` + if [ $INFSTAB -eq 0 ] ; then + RESULT=0 + RAIDDEV="$RAIDDEV(skipped)" + fi NOAUTO=`grep "^$i" /etc/fstab | grep -c "noauto"` if [ $NOAUTO -gt 0 ]; then RESULT=0 -- cgit v1.2.1