summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDoug Goldstein <cardoe@gentoo.org>2008-01-30 14:37:06 +0000
committerDoug Goldstein <cardoe@gentoo.org>2008-01-30 14:37:06 +0000
commitdff17370848afd261e2eb2c9be3f58eeeb499f01 (patch)
treef509240c6aac0087b714a53c6ad024eff0c52ac7 /sys-fs/lvm2/files
parentalpha/ia64/sparc stable wrt #208039 (diff)
downloadhistorical-dff17370848afd261e2eb2c9be3f58eeeb499f01.tar.gz
historical-dff17370848afd261e2eb2c9be3f58eeeb499f01.tar.bz2
historical-dff17370848afd261e2eb2c9be3f58eeeb499f01.zip
ignore rootfs entries in mount and mtab during shutdown. Fixes issues with shutting down in some cases.
Package-Manager: portage-2.1.4
Diffstat (limited to 'sys-fs/lvm2/files')
-rw-r--r--sys-fs/lvm2/files/digest-lvm2-2.02.28-r53
-rwxr-xr-xsys-fs/lvm2/files/lvm2-stop.sh-2.02.28-r565
2 files changed, 68 insertions, 0 deletions
diff --git a/sys-fs/lvm2/files/digest-lvm2-2.02.28-r5 b/sys-fs/lvm2/files/digest-lvm2-2.02.28-r5
new file mode 100644
index 000000000000..920c6a9cc962
--- /dev/null
+++ b/sys-fs/lvm2/files/digest-lvm2-2.02.28-r5
@@ -0,0 +1,3 @@
+MD5 940a882a71cae84f6befc8069a260ad1 LVM2.2.02.28.tgz 531905
+RMD160 bf6f25db6e34bf362353ae9557691a7f01962502 LVM2.2.02.28.tgz 531905
+SHA256 2d8d7b123e427d0bfb7471d7c17dfd88890eb98257ca22ea3be5d7307e83aceb LVM2.2.02.28.tgz 531905
diff --git a/sys-fs/lvm2/files/lvm2-stop.sh-2.02.28-r5 b/sys-fs/lvm2/files/lvm2-stop.sh-2.02.28-r5
new file mode 100755
index 000000000000..fda3de467ec0
--- /dev/null
+++ b/sys-fs/lvm2/files/lvm2-stop.sh-2.02.28-r5
@@ -0,0 +1,65 @@
+# /lib/rcscripts/addons/lvm-stop.sh
+# $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 $
+
+# Stop LVM2
+if [ -x /sbin/vgchange ] && \
+ [ -x /sbin/lvdisplay ] && \
+ [ -x /sbin/vgdisplay ] && \
+ [ -x /sbin/lvchange ] && \
+ [ -f /etc/lvmtab -o -d /etc/lvm ] && \
+ [ -d /proc/lvm -o "`grep device-mapper /proc/misc 2>/dev/null`" ]
+then
+ einfo "Shutting down the Logical Volume Manager"
+ # If these commands fail it is not currently an issue
+ # as the system is going down anyway based on the current LVM
+ # functionality as described in this forum thread
+ #https://www.redhat.com/archives/linux-lvm/2001-May/msg00523.html
+
+ LOGICAL_VOLUMES=`lvdisplay |grep "LV Name"|sed -e 's/.*LV Name\s*\(.*\)/\1/'|sort`
+ VOLUME_GROUPS=`vgdisplay |grep "VG Name"|sed -e 's/.*VG Name\s*\(.*\)/\1/'|sort`
+ for x in ${LOGICAL_VOLUMES}
+ do
+ LV_IS_ACTIVE=`lvdisplay ${x}|grep "# open"|awk '{print $3}'`
+ if [ "${LV_IS_ACTIVE}" = 0 ]
+ then
+ ebegin " Shutting Down logical volume: ${x} "
+ lvchange -an --ignorelockingfailure -P ${x} >/dev/null
+ eend $?
+ fi
+ done
+
+ for x in ${VOLUME_GROUPS}
+ do
+ VG_HAS_ACTIVE_LV=`vgdisplay ${x}|grep "Open LV"|sed -e 's/.*Open LV\s*\(.*\)/\1/'`
+ if [ "${VG_HAS_ACTIVE_LV}" = 0 ]
+ then
+ ebegin " Shutting Down volume group: ${x} "
+ vgchange -an --ignorelockingfailure -P ${x} >/dev/null
+ eend
+ fi
+ done
+
+ for x in ${LOGICAL_VOLUMES}
+ do
+ LV_IS_ACTIVE=`lvdisplay ${x}|grep "# open"|sed -e 's/.*# open\s*\(.*\)/\1/'`
+ if [ "${LV_IS_ACTIVE}" = 1 ]
+ then
+ if type mountinfo >/dev/null 2>&1; then
+ ROOT_DEVICE=`mountinfo -t /`
+ else
+ ROOT_DEVICE=`mount|grep -v 'rootfs'|grep " / "|awk '{print $1}'`
+ fi
+
+ MOUNTED_DEVICE=${x}
+ [ -L ${ROOT_DEVICE} ] && ROOT_DEVICE="`/bin/readlink ${ROOT_DEVICE}`"
+ [ -L ${x} ] && MOUNTED_DEVICE="`/bin/readlink ${x}`"
+ if [ ! ${ROOT_DEVICE} = ${MOUNTED_DEVICE} ]
+ then
+ ewarn " Unable to shutdown: ${x} "
+ fi
+ fi
+ done
+ einfo "Finished Shutting down the Logical Volume Manager"
+fi
+
+# vim:ts=4