From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: From: Alexey Borovskoy To: devel@altlinux.ru Date: Sun, 29 May 2005 14:52:50 +1300 User-Agent: KMail/1.6.2 MIME-Version: 1.0 Content-Type: multipart/signed; protocol="application/pgp-signature"; micalg=pgp-sha1; boundary="Boundary-03=_8BSmC1uPzM/mH0O"; charset="koi8-r" Content-Transfer-Encoding: 7bit Message-Id: <200505291453.00839.alb@altlinux.ru> Subject: [devel] Master 2.4 LVM an RAID startup X-BeenThere: devel@altlinux.ru X-Mailman-Version: 2.1.5 Precedence: list Reply-To: ALT Devel discussion list List-Id: ALT Devel discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 May 2005 01:53:51 -0000 Archived-At: List-Archive: List-Post: --Boundary-03=_8BSmC1uPzM/mH0O Content-Type: multipart/mixed; boundary="Boundary-01=_yBSmCv9PG7vwtC3" Content-Transfer-Encoding: 7bit Content-Disposition: inline --Boundary-01=_yBSmCv9PG7vwtC3 Content-Type: text/plain; charset="koi8-r" Content-Transfer-Encoding: base64 Content-Disposition: inline 5M/C0tnKIMTFztguCgr6wcjP1MXMz9PYIM3OxSBMVk0g0M/XxdLIIE1ECgrzzsHewczBIMLZzCDN z8TJxsnDydLP18HOIC9ldGMvcmMuZC9yYy5zeXNpbml0INPMxcTVwN3JzSAK09DP08/Cz80uCjEu IPPQxdLXwSDBy9TJ18nS1cXNIE1ELgoyLiD6wdTFzSDBy9TJ18nS1cXNIExWTS4KMy4g+sHUxc0g wcvUydfJ0tXFzSBzd2FwLgoK8M/Uz80gwtnMIM3PxMnGycPJ0s/Xwc4gL2V0Yy9pbml0LmQvaGFs dCDTzMXE1cDdyc0gz8LSwdrPzS4KMS4g+sHUxc0gz9TLzMDewcXNIHN3YXAuCjIuIO/Uy8zA3sHF zSBMVk0uCjMuIO/Uy8zA3sHFzSBNRC4KCvEg0M/Oyc3BwCDe1M8gyMHLLCDOzyDNz9bF1CDC2dTY INzUzyDTxMXMwdTYINDSwdfJzNjOzyDJINrB1MXNIArX2dDV09TJ1NggdXBkYXRlIM7BIHN0YXJ0 dXA/CgrwwdTeINDSyczBx8HF1NPRLiDoz9TFzCDT0MXS18Eg1yDHzMDLz9rB19LBLCDEwSDOxSDO wdvFzCDLwcsg1yAKzsXNIMHU1MHeySDQ0snDxdDM0dTYLgoKLS0gCuHMxcvTxcouCkdQRyBrZXkg ZmluZ2VycHJpbnQKREJCMyAxODMyIDEzQzYgNUM5NiA0QTU4ICA0QUZGIDc4RjcgMTU5RiA2NkFE IDhEN0UK --Boundary-01=_yBSmCv9PG7vwtC3 Content-Type: text/x-diff; charset="koi8-r"; name="startup.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="startup.patch" diff -uNr rc.d.orig/init.d/halt rc.d/init.d/halt =2D-- rc.d.orig/init.d/halt 2004-03-05 02:28:34 +1200 +++ rc.d/init.d/halt 2005-05-29 14:33:46 +1300 @@ -102,6 +102,14 @@ "Unmounting filesystem" \ "Unmounting filesystem (retry)" =20 +# LVM Shutdown +VGCHANGE=3D/sbin/vgchange +if [ -x "$VGCHANGE" -a -s /etc/lvmtab ]; then + if [ -e /proc/lvm ]; then + action "Setting up LVM:" "$VGCHANGE" -a n + fi +fi +=09 # Turn off raid. RAIDSTOP=3D/sbin/raidstop if [ -x "$RAIDSTOP" -a -f /etc/raidtab ]; then diff -uNr rc.d.orig/rc.sysinit rc.d/rc.sysinit =2D-- rc.d.orig/rc.sysinit 2004-03-06 01:25:28 +1200 +++ rc.d/rc.sysinit 2005-05-29 14:29:13 +1300 @@ -81,6 +81,75 @@ # Set the system clock (when /etc/adjtime is missing). [ -s /etc/adjtime ] || /etc/init.d/clock start =20 +# Activate EVMS +EVMS_ACTIVE=3D +STARTEVMS=3D/sbin/startevms +if [ -x "$STARTEVMS" ] && ! fgrep -iwqs noevms /proc/cmdline; then + action "Starting up EVMS:" "$STARTEVMS" init + EVMS_ACTIVE=3D1 +fi + +# Add raid devices +if [ -z "$EVMS_ACTIVE" ] && [ -f /proc/mdstat -a -s /etc/raidtab ] && ! fg= rep -iwqs noraidtab /proc/cmdline; then + echo -n "Starting up RAID devices: "=20 + + rc=3D0 +=09 + for i in `grep -s "^raiddev" /etc/raidtab | awk '{print $2}'`; do + RAIDDEV=3D"${i##*/}" + RAIDSTAT=3D`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=3D1 + ExecIfExecutable /sbin/raidstart "$i" + RESULT=3D$? + if [ $RESULT -gt 0 ]; then + ExecIfExecutable /sbin/raid0run "$i" + RESULT=3D$? + fi + if [ $RESULT -gt 0 ]; then + ExecIfExecutable /sbin/raidadd "$i" + ExecIfExecutable /sbin/raidrun "$i" + RESULT=3D$? + fi + if [ $RESULT -gt 0 ]; then + rc=3D1 + fi + fi + echo -n "$RAIDDEV " + done + echo + + # A non-zero return means there were problems. + if [ $rc -gt 0 ]; then + echo + echo + echo "*** An error occurred during the RAID startup" + echo "*** Dropping you to a shell; the system will reboot" + echo "*** when you leave the shell." + + PS1=3D"(RAID Repair) \# # "; export PS1 + sulogin + + echo "Unmounting file systems" + umount -arnf + mount -n -o remount,ro / + echo "Automatic reboot in progress." + reboot -f + fi +fi + +# LVM Setting +VGCHANGE=3D/sbin/vgchange +if [ -x "$VGCHANGE" -a -s /etc/lvmtab ]; then + modprobe lvm-mod >/dev/null 2>&1 + if [ -e /proc/lvm ]; then + action "Setting up LVM:" "$VGCHANGE" -a y + fi +fi + # Activate swapping. action "Activating swap partitions:" swapon -a -e =20 @@ -114,15 +183,6 @@ fsckoptions=3D"-V $fsckoptions" fi =20 =2D# LVM Setting =2DVGCHANGE=3D/sbin/vgchange =2Dif [ -x "$VGCHANGE" -a -s /etc/lvmtab ]; then =2D modprobe lvm-mod >/dev/null 2>&1 =2D if [ -e /proc/lvm ]; then =2D action "Setting up LVM:" "$VGCHANGE" -a y =2D fi =2Dfi =2D _RUN_QUOTACHECK=3D0 ROOTFSTYPE=3D`fgrep ' / ' /proc/mounts |tail -1 |cut -d' ' -f3` if [ -z "$fastboot" -a "$ROOTFSTYPE" !=3D nfs ]; then=20 @@ -263,66 +323,6 @@ setsysfont >/dev/null 2>&1 && SETSYSFONT_DONE=3D1 || SETSYSFONT_DONE=3D fi =20 =2D# Activate EVMS =2DEVMS_ACTIVE=3D =2DSTARTEVMS=3D/sbin/startevms =2Dif [ -x "$STARTEVMS" ] && ! fgrep -iwqs noevms /proc/cmdline; then =2D action "Starting up EVMS:" "$STARTEVMS" init =2D EVMS_ACTIVE=3D1 =2Dfi =2D =2D# Add raid devices =2Dif [ -z "$EVMS_ACTIVE" ] && [ -f /proc/mdstat -a -s /etc/raidtab ] && ! = fgrep -iwqs noraidtab /proc/cmdline; then =2D echo -n "Starting up RAID devices: "=20 =2D =2D rc=3D0 =2D=09 =2D for i in `grep -s "^raiddev" /etc/raidtab | awk '{print $2}'`; do =2D RAIDDEV=3D"${i##*/}" =2D RAIDSTAT=3D`grep -s "^$RAIDDEV : active" /proc/mdstat` =2D if [ -z "$RAIDSTAT" ]; then =2D # Try raidstart first...if that fails then =2D # fall back to raidadd, raidrun. If that =2D # also fails, then we drop to a shell =2D RESULT=3D1 =2D ExecIfExecutable /sbin/raidstart "$i" =2D RESULT=3D$? =2D if [ $RESULT -gt 0 ]; then =2D ExecIfExecutable /sbin/raid0run "$i" =2D RESULT=3D$? =2D fi =2D if [ $RESULT -gt 0 ]; then =2D ExecIfExecutable /sbin/raidadd "$i" =2D ExecIfExecutable /sbin/raidrun "$i" =2D RESULT=3D$? =2D fi =2D if [ $RESULT -gt 0 ]; then =2D rc=3D1 =2D fi =2D fi =2D echo -n "$RAIDDEV " =2D done =2D echo =2D =2D # A non-zero return means there were problems. =2D if [ $rc -gt 0 ]; then =2D echo =2D echo =2D echo "*** An error occurred during the RAID startup" =2D echo "*** Dropping you to a shell; the system will reboot" =2D echo "*** when you leave the shell." =2D =2D PS1=3D"(RAID Repair) \# # "; export PS1 =2D sulogin =2D =2D echo "Unmounting file systems" =2D umount -arnf =2D mount -n -o remount,ro / =2D echo "Automatic reboot in progress." =2D reboot -f =2D fi =2Dfi =2D _RUN_QUOTACHECK=3D0 # Check filesystems # (pixel) do not check loopback files, will be done later (aren't availabl= e yet) --Boundary-01=_yBSmCv9PG7vwtC3-- --Boundary-03=_8BSmC1uPzM/mH0O Content-Type: application/pgp-signature Content-Description: signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.5 (GNU/Linux) iD8DBQBCmSB8ePcVn2atjX4RAqwjAJ9KaNzhPP/XC0TMX5YZT6qO+lLwnQCfWvRu lhbetv0wx6wg2HqdmflbI5Q= =/7wJ -----END PGP SIGNATURE----- --Boundary-03=_8BSmC1uPzM/mH0O--