Gentoo Archives: gentoo-commits

From: "Doug Klima (cardoe)" <cardoe@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in sys-fs/lvm2/files: lvm2-stop.sh-2.02.28-r5 digest-lvm2-2.02.28-r5
Date: Wed, 30 Jan 2008 14:37:11
Message-Id: E1JKE3n-0000lL-6b@stork.gentoo.org
1 cardoe 08/01/30 14:37:07
2
3 Added: lvm2-stop.sh-2.02.28-r5 digest-lvm2-2.02.28-r5
4 Log:
5 ignore rootfs entries in mount and mtab during shutdown. Fixes issues with shutting down in some cases.
6 (Portage version: 2.1.4)
7
8 Revision Changes Path
9 1.1 sys-fs/lvm2/files/lvm2-stop.sh-2.02.28-r5
10
11 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-fs/lvm2/files/lvm2-stop.sh-2.02.28-r5?rev=1.1&view=markup
12 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-fs/lvm2/files/lvm2-stop.sh-2.02.28-r5?rev=1.1&content-type=text/plain
13
14 Index: lvm2-stop.sh-2.02.28-r5
15 ===================================================================
16 # /lib/rcscripts/addons/lvm-stop.sh
17 # $Header: /var/cvsroot/gentoo-x86/sys-fs/lvm2/files/lvm2-stop.sh-2.02.28-r5,v 1.1 2008/01/30 14:37:06 cardoe Exp $
18
19 # Stop LVM2
20 if [ -x /sbin/vgchange ] && \
21 [ -x /sbin/lvdisplay ] && \
22 [ -x /sbin/vgdisplay ] && \
23 [ -x /sbin/lvchange ] && \
24 [ -f /etc/lvmtab -o -d /etc/lvm ] && \
25 [ -d /proc/lvm -o "`grep device-mapper /proc/misc 2>/dev/null`" ]
26 then
27 einfo "Shutting down the Logical Volume Manager"
28 # If these commands fail it is not currently an issue
29 # as the system is going down anyway based on the current LVM
30 # functionality as described in this forum thread
31 #https://www.redhat.com/archives/linux-lvm/2001-May/msg00523.html
32
33 LOGICAL_VOLUMES=`lvdisplay |grep "LV Name"|sed -e 's/.*LV Name\s*\(.*\)/\1/'|sort`
34 VOLUME_GROUPS=`vgdisplay |grep "VG Name"|sed -e 's/.*VG Name\s*\(.*\)/\1/'|sort`
35 for x in ${LOGICAL_VOLUMES}
36 do
37 LV_IS_ACTIVE=`lvdisplay ${x}|grep "# open"|awk '{print $3}'`
38 if [ "${LV_IS_ACTIVE}" = 0 ]
39 then
40 ebegin " Shutting Down logical volume: ${x} "
41 lvchange -an --ignorelockingfailure -P ${x} >/dev/null
42 eend $?
43 fi
44 done
45
46 for x in ${VOLUME_GROUPS}
47 do
48 VG_HAS_ACTIVE_LV=`vgdisplay ${x}|grep "Open LV"|sed -e 's/.*Open LV\s*\(.*\)/\1/'`
49 if [ "${VG_HAS_ACTIVE_LV}" = 0 ]
50 then
51 ebegin " Shutting Down volume group: ${x} "
52 vgchange -an --ignorelockingfailure -P ${x} >/dev/null
53 eend
54 fi
55 done
56
57 for x in ${LOGICAL_VOLUMES}
58 do
59 LV_IS_ACTIVE=`lvdisplay ${x}|grep "# open"|sed -e 's/.*# open\s*\(.*\)/\1/'`
60 if [ "${LV_IS_ACTIVE}" = 1 ]
61 then
62 if type mountinfo >/dev/null 2>&1; then
63 ROOT_DEVICE=`mountinfo -t /`
64 else
65 ROOT_DEVICE=`mount|grep -v 'rootfs'|grep " / "|awk '{print $1}'`
66 fi
67
68 MOUNTED_DEVICE=${x}
69 [ -L ${ROOT_DEVICE} ] && ROOT_DEVICE="`/bin/readlink ${ROOT_DEVICE}`"
70 [ -L ${x} ] && MOUNTED_DEVICE="`/bin/readlink ${x}`"
71 if [ ! ${ROOT_DEVICE} = ${MOUNTED_DEVICE} ]
72 then
73 ewarn " Unable to shutdown: ${x} "
74 fi
75 fi
76 done
77 einfo "Finished Shutting down the Logical Volume Manager"
78 fi
79
80 # vim:ts=4
81
82
83
84 1.1 sys-fs/lvm2/files/digest-lvm2-2.02.28-r5
85
86 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-fs/lvm2/files/digest-lvm2-2.02.28-r5?rev=1.1&view=markup
87 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-fs/lvm2/files/digest-lvm2-2.02.28-r5?rev=1.1&content-type=text/plain
88
89 Index: digest-lvm2-2.02.28-r5
90 ===================================================================
91 MD5 940a882a71cae84f6befc8069a260ad1 LVM2.2.02.28.tgz 531905
92 RMD160 bf6f25db6e34bf362353ae9557691a7f01962502 LVM2.2.02.28.tgz 531905
93 SHA256 2d8d7b123e427d0bfb7471d7c17dfd88890eb98257ca22ea3be5d7307e83aceb LVM2.2.02.28.tgz 531905
94
95
96
97 --
98 gentoo-commits@l.g.o mailing list