ALT Linux Bugzilla
– Attachment 836 Details for
Bug 6397
rc.sysinit script should try not only raidtools but also mdadm for mounting md devices
New bug
|
Search
|
[?]
|
Help
Register
|
Log In
[x]
|
Forgot Password
Login:
[x]
|
EN
|
RU
[patch]
proposed patch
startup-raid.diff (text/plain), 3.27 KB, created by
Dmitry V. Levin
on 2005-04-25 02:13:50 MSD
(
hide
)
Description:
proposed patch
Filename:
MIME Type:
Creator:
Dmitry V. Levin
Created:
2005-04-25 02:13:50 MSD
Size:
3.27 KB
patch
obsolete
>--- rc.sysinit 24 Apr 2005 21:31:06 -0000 1.55 >+++ rc.sysinit 24 Apr 2005 22:09:26 -0000 >@@ -285,39 +285,9 @@ if [ -x "$STARTEVMS" ] && ! grep -iwqs n > fi > > # Add raid devices >-if [ -z "$EVMS_ACTIVE" ] && [ -f /proc/mdstat -a -s /etc/raidtab ] && ! grep -iwqs noraidtab /proc/cmdline; then >- echo -n "Starting up RAID devices: " >- >- rc=0 >- for i in `grep -s "^raiddev" /etc/raidtab | awk '{print $2}'`; do >- RAIDDEV="${i##*/}" >- RAIDSTAT=`grep -s "^$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 >- RESULT=1 >- ExecIfExecutable /sbin/raidstart "$i" >- RESULT=$? >- if [ $RESULT -gt 0 ]; then >- ExecIfExecutable /sbin/raid0run "$i" >- RESULT=$? >- fi >- if [ $RESULT -gt 0 ]; then >- ExecIfExecutable /sbin/raidadd "$i" >- ExecIfExecutable /sbin/raidrun "$i" >- RESULT=$? >- fi >- if [ $RESULT -gt 0 ]; then >- rc=1 >- fi >- fi >- echo -n "$RAIDDEV " >- done >- echo >- >+if [ -z "$EVMS_ACTIVE" ] && [ -f /proc/mdstat ]; then > # A non-zero return means there were problems. >- if [ $rc -gt 0 ]; then >+ if ! /etc/rc.d/scripts/raidstart; then > echo > echo > echo "*** An error occurred during the RAID startup" >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ scripts/raidstart 24 Apr 2005 22:08:10 -0000 >@@ -0,0 +1,97 @@ >+#!/bin/sh >+ >+exec_if_executable() >+{ >+ local f >+ f="$1" >+ shift >+ [ -x "$f" ] && "$f" "$@" >+} >+ >+mdadm_found() >+{ >+ [ -s /etc/mdadm.conf ] || return 1 >+ local f >+ for f in /sbin/mdadm /usr/sbin/mdadm /sbin/mdassemble /usr/sbin/mdassemble; do >+ [ -x "$f" ] && return 0 >+ done >+ return 1 >+} >+ >+raidtools_found() >+{ >+ [ -s /etc/raidtab ] || return 1 >+ local f >+ for f in /sbin/raidstart /sbin/raid0run /sbin/raidadd; do >+ [ -x "$f" ] && return 0 >+ done >+ return 1 >+} >+ >+start_raid_using_mdadm() >+{ >+ [ -s /etc/mdadm.conf ] || return 1 >+ local f >+ for f in /sbin/mdadm /usr/sbin/mdadm; do >+ [ -x "$f" ] || continue >+ echo -n "(using mdadm) " >+ "$f" --assemble --scan >+ return $? >+ done >+ for f in /sbin/mdassemble /usr/sbin/mdassemble; do >+ [ -x "$f" ] || continue >+ echo -n "(using mdassemble) " >+ "$f" >+ return $? >+ done >+ return 1 >+} >+ >+start_raid_using_raidtools() >+{ >+ [ -s /etc/raidtab ] || return 1 >+ local rc=0 i dev stat res >+ echo -n "(using raidtools) " >+ for i in `grep -s "^raiddev" /etc/raidtab | awk '{print $2}'`; do >+ dev="${i##*/}" >+ stat=`grep -s "^$dev : active" /proc/mdstat` >+ if [ -z "$stat" ]; then >+ # Try raidstart first...if that fails then >+ # fall back to raidadd, raidrun. If that >+ # also fails, then we drop to a shell >+ res=1 >+ exec_if_executable /sbin/raidstart "$i" >+ res=$? >+ if [ $res -gt 0 ]; then >+ exec_if_executable /sbin/raid0run "$i" >+ res=$? >+ fi >+ if [ $res -gt 0 ]; then >+ exec_if_executable /sbin/raidadd "$i" >+ exec_if_executable /sbin/raidrun "$i" >+ res=$? >+ fi >+ if [ $res -gt 0 ]; then >+ rc=1 >+ fi >+ fi >+ echo -n "$dev " >+ done >+ return $rc >+} >+ >+[ -f /proc/mdstat ] && ! grep -iwqs noraidtab /proc/cmdline || exit 0 >+ >+rc=0 >+if mdadm_found; then >+ echo -n "Starting up RAID devices: " >+ start_raid_using_mdadm >+ rc=$? >+ echo >+elif raidtools_found; then >+ echo -n "Starting up RAID devices: " >+ start_raid_using_raidtools >+ rc=$? >+ echo >+fi >+exit $rc
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 6397
:
795
|
796
|
802
| 836