diff options
author | Bill Nottingham <notting@redhat.com> | 1999-08-13 14:44:14 +0000 |
---|---|---|
committer | Bill Nottingham <notting@redhat.com> | 1999-08-13 14:44:14 +0000 |
commit | b0b6034beb048519e34bb623100cc194c99358ba (patch) | |
tree | c71eefa1a75634b02bf62326796f21d02f6c5c11 /rc.d | |
parent | fe3cda29459f108e5114d1572c3ff78466414171 (diff) | |
download | initscripts-b0b6034beb048519e34bb623100cc194c99358ba.tar initscripts-b0b6034beb048519e34bb623100cc194c99358ba.tar.gz initscripts-b0b6034beb048519e34bb623100cc194c99358ba.tar.bz2 initscripts-b0b6034beb048519e34bb623100cc194c99358ba.tar.xz initscripts-b0b6034beb048519e34bb623100cc194c99358ba.zip |
new raid startup stuff from Doug
Diffstat (limited to 'rc.d')
-rwxr-xr-x | rc.d/rc.sysinit | 41 |
1 files changed, 32 insertions, 9 deletions
diff --git a/rc.d/rc.sysinit b/rc.d/rc.sysinit index 0f57fadf..85ea38cd 100755 --- a/rc.d/rc.sysinit +++ b/rc.d/rc.sysinit @@ -267,16 +267,39 @@ if [ -f /etc/rc.d/rc.modules ]; then /etc/rc.d/rc.modules fi -# Add raid devices, old style... -if [ -f /proc/mdstat -a -f /etc/raidtab -a -x /sbin/raidadd ]; then - action "Starting up RAID devices" raidadd -a +# Add raid devices +if [ -f /proc/mdstat -a -f /etc/raidtab ]; then + echo -n "Starting up RAID devices: " - rc=$? - - if [ $rc = 0 ]; then - raidrun -a - rc=$? - fi + rc=0 + + for i in `grep "raiddev" /etc/raidtab | awk '{print $2}'` + do + RAIDDEV=`basename $i` + RAIDSTAT=`grep "^$RAIDDEV : active" /proc/mdstat` + if [ -z "$RAIDSTAT" ]; then + # Try raidstart first...if that fails then + # fall back to raidadd, raidrun. If that + # also fails, then we drop to a shell + if [ -x raidstart ]; then + raidstart $i + RESULT=$? + else + RESULT=1 + fi + if [ $RESULT -gt 0 -a -x raidadd -a -x raidrun ]; then + raidadd $i + raidrun $i + RESULT=$? + fi + if [ $RESULT -gt 0 ]; then + rc=1 + fi + echo -n "$RAIDDEV " + else + echo -n "$RAIDDEV " + fi + done # A non-zero return means there were problems. if [ $rc -gt 0 ]; then |