diff options
author | Christian Zoffoli <xmerlin@gentoo.org> | 2008-11-21 23:31:44 +0000 |
---|---|---|
committer | Christian Zoffoli <xmerlin@gentoo.org> | 2008-11-21 23:31:44 +0000 |
commit | 1206c1453c3a2bd17c1c96f060fe771406a710f0 (patch) | |
tree | 4174713dbff4c14f2c983d952f9ddc4a73947b05 /sys-fs/clvm | |
parent | Bump geany to 0.15 for drac. Bug drac about bugs. (diff) | |
download | gentoo-2-1206c1453c3a2bd17c1c96f060fe771406a710f0.tar.gz gentoo-2-1206c1453c3a2bd17c1c96f060fe771406a710f0.tar.bz2 gentoo-2-1206c1453c3a2bd17c1c96f060fe771406a710f0.zip |
Version bump, removed a broken version, new init.
(Portage version: 2.1.4.4)
Diffstat (limited to 'sys-fs/clvm')
-rw-r--r-- | sys-fs/clvm/ChangeLog | 13 | ||||
-rw-r--r-- | sys-fs/clvm/clvm-2.02.39.ebuild (renamed from sys-fs/clvm/clvm-2.02.36.ebuild) | 22 | ||||
-rw-r--r-- | sys-fs/clvm/files/cluster-locking-built-in.patch | 100 | ||||
-rw-r--r-- | sys-fs/clvm/files/clvmd.confd | 3 | ||||
-rwxr-xr-x | sys-fs/clvm/files/clvmd.rc | 110 | ||||
-rwxr-xr-x | sys-fs/clvm/files/clvmd.rc-2.02.33-xm | 146 | ||||
-rw-r--r-- | sys-fs/clvm/files/lvm.confd (renamed from sys-fs/clvm/files/lvm.confd-2.02.28-r2) | 0 | ||||
-rw-r--r-- | sys-fs/clvm/files/lvm.rc (renamed from sys-fs/clvm/files/lvm.rc-2.02.28-r2) | 2 | ||||
-rwxr-xr-x | sys-fs/clvm/files/lvm2-start.sh | 8 | ||||
-rw-r--r-- | sys-fs/clvm/files/lvm2-start.sh-2.02.33-xm | 34 | ||||
-rwxr-xr-x | sys-fs/clvm/files/lvm2-stop.sh | 2 | ||||
-rwxr-xr-x | sys-fs/clvm/files/lvm2-stop.sh-2.02.33-xm | 61 |
12 files changed, 100 insertions, 401 deletions
diff --git a/sys-fs/clvm/ChangeLog b/sys-fs/clvm/ChangeLog index 2734873aa905..418893821758 100644 --- a/sys-fs/clvm/ChangeLog +++ b/sys-fs/clvm/ChangeLog @@ -1,6 +1,17 @@ # ChangeLog for sys-fs/clvm # Copyright 1999-2008 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sys-fs/clvm/ChangeLog,v 1.25 2008/11/14 09:10:43 xmerlin Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-fs/clvm/ChangeLog,v 1.26 2008/11/21 23:31:43 xmerlin Exp $ + +*clvm-2.02.39 (22 Nov 2008) + + 22 Nov 2008; Christian Zoffoli <xmerlin@gentoo.org> + -files/lvm.confd-2.02.28-r2, -files/lvm.rc-2.02.28-r2, + -files/clvmd.rc-2.02.33-xm, -files/cluster-locking-built-in.patch, + +files/clvmd.confd, files/clvmd.rc, +files/lvm.confd, +files/lvm.rc, + files/lvm2-start.sh, files/lvm2-stop.sh, -files/lvm2-start.sh-2.02.33-xm, + -files/lvm2-stop.sh-2.02.33-xm, -clvm-2.02.36.ebuild, + +clvm-2.02.39.ebuild: + Version bump, removed a broken version, new init. *clvm-2.02.36 (14 Nov 2008) diff --git a/sys-fs/clvm/clvm-2.02.36.ebuild b/sys-fs/clvm/clvm-2.02.39.ebuild index 46402551bff9..76941fb123ce 100644 --- a/sys-fs/clvm/clvm-2.02.36.ebuild +++ b/sys-fs/clvm/clvm-2.02.39.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2008 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-fs/clvm/clvm-2.02.36.ebuild,v 1.1 2008/11/14 09:10:43 xmerlin Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-fs/clvm/clvm-2.02.39.ebuild,v 1.1 2008/11/21 23:31:43 xmerlin Exp $ inherit eutils multilib @@ -14,9 +14,9 @@ LICENSE="GPL-2" SLOT="0" KEYWORDS="~amd64 ~x86" -IUSE="readline static selinux" +IUSE="readline static selinux nolvmstatic" -DEPEND=">=sys-fs/device-mapper-1.02.24 +DEPEND=">=sys-fs/device-mapper-1.02.27 =sys-cluster/dlm-2* =sys-cluster/cman-2* " @@ -32,7 +32,7 @@ src_unpack() { cd "${S}" epatch "${FILESDIR}"/lvm.conf-2.02.33.patch || die - epatch "${FILESDIR}"/cluster-locking-built-in.patch || die + #epatch "${FILESDIR}"/cluster-locking-built-in.patch || die } src_compile() { @@ -87,6 +87,7 @@ src_compile() { src_install() { emake DESTDIR="${D}" install + # TODO: At some point in the future, we need to stop installing the static # as the /sbin/lvm name, and have both variants seperate. if use static; then @@ -105,11 +106,14 @@ src_install() { dodoc README VERSION WHATS_NEW doc/*.{conf,c,txt} insinto /lib/rcscripts/addons - newins "${FILESDIR}"/lvm2-start.sh-2.02.33-xm lvm-start.sh || die - newins "${FILESDIR}"/lvm2-stop.sh-2.02.33-xm lvm-stop.sh || die - newinitd "${FILESDIR}"/lvm.rc-2.02.28-r2 lvm || die - newconfd "${FILESDIR}"/lvm.confd-2.02.28-r2 lvm || die - newinitd "${FILESDIR}"/clvmd.rc-2.02.33-xm clvmd || die + newins "${FILESDIR}"/lvm2-start.sh lvm-start.sh || die + newins "${FILESDIR}"/lvm2-stop.sh lvm-stop.sh || die + + newinitd "${FILESDIR}"/lvm.rc lvm || die + newconfd "${FILESDIR}"/lvm.confd lvm || die + + newinitd "${FILESDIR}"/clvmd.rc clvmd || die + newconfd "${FILESDIR}"/clvmd.confd clvmd || die elog "" elog "Rebuild your genkernel initramfs if you are using lvm" diff --git a/sys-fs/clvm/files/cluster-locking-built-in.patch b/sys-fs/clvm/files/cluster-locking-built-in.patch deleted file mode 100644 index 52fb82380ed7..000000000000 --- a/sys-fs/clvm/files/cluster-locking-built-in.patch +++ /dev/null @@ -1,100 +0,0 @@ ---- LVM2.2.02.12-old/scripts/lvmconf.sh 2006-09-20 18:36:47.000000000 +0100 -+++ LVM2.2.02.12/scripts/lvmconf.sh 2006-10-20 19:20:26.000000000 +0100 -@@ -36,7 +36,7 @@ function parse_args - while [ -n "$1" ]; do - case $1 in - --enable-cluster) -- LOCKING_TYPE=2 -+ LOCKING_TYPE=3 - shift - ;; - --disable-cluster) -@@ -94,15 +94,13 @@ function validate_args - - if [ -n "$LOCKINGLIBDIR" ]; then - -- [ -z "$LOCKINGLIB" ] && LOCKINGLIB="liblvm2clusterlock.so" -- - if [ "${LOCKINGLIBDIR:0:1}" != "/" ] - then - echo "Prefix must be an absolute path name (starting with a /)" - exit 12 - fi - -- if [ ! -f "$LOCKINGLIBDIR/$LOCKINGLIB" ] -+ if [ -n "$LOCKINGLIB" ] && [ ! -f "$LOCKINGLIBDIR/$LOCKINGLIB" ] - then - echo "$LOCKINGLIBDIR/$LOCKINGLIB does not exist, did you do a \"make install\" ?" - exit 11 -@@ -170,13 +168,29 @@ then - if [ -z "$LOCKING_TYPE" ]; then - LOCKING_TYPE=1 - fi -- if [ "$LOCKING_TYPE" = "2" ]; then -+ if [ "$LOCKING_TYPE" = "3" ] || [ "$LOCKING_TYPE" = "2" ]; then - cat $CONFIGFILE - <<EOF > $TMPFILE - global { - # Enable locking for cluster LVM - locking_type = $LOCKING_TYPE - library_dir = "$LOCKINGLIBDIR" -+EOF -+ if [ $? != 0 ] -+ then -+ echo "failed to create temporary config file, $CONFIGFILE not updated" -+ exit 14 -+ fi -+ if [ -n "$LOCKINGLIB" ]; then -+ cat - <<EOF >> $TMPFILE - locking_library = "$LOCKINGLIB" -+EOF -+ if [ $? != 0 ] -+ then -+ echo "failed to create temporary config file, $CONFIGFILE not updated" -+ exit 16 -+ fi -+ fi -+ cat - <<EOF >> $TMPFILE - } - EOF - fi # if we aren't setting cluster locking, we don't need to create a global section -@@ -184,7 +198,7 @@ EOF - if [ $? != 0 ] - then - echo "failed to create temporary config file, $CONFIGFILE not updated" -- exit 14 -+ exit 17 - fi - else - # -@@ -208,8 +222,10 @@ else - else - SEDCMD="${SEDCMD}\n/global[[:blank:]]*{/a\ \ \ \ library_dir = \"$LOCKINGLIBDIR\"" - fi -+ fi - -- if [ "$have_library" = "0" ] -+ if [ -n "$LOCKINGLIB" ]; then -+ if [ "$have_library" = "0" ] - then - SEDCMD="${SEDCMD}\ns/^[[:blank:]]*locking_library[[:blank:]]*=.*/\ \ \ \ locking_library = \"$LOCKINGLIB\"/g" - else -@@ -217,19 +233,6 @@ else - fi - fi - -- if [ "$LOCKING_TYPE" = "1" ]; then -- # if we're not using cluster locking, remove the library dir and locking library name -- if [ "$have_dir" = "0" ] -- then -- SEDCMD="${SEDCMD}\n/^[[:blank:]]*library_dir[[:blank:]]*=.*/d" -- fi -- -- if [ "$have_library" = "0" ] -- then -- SEDCMD="${SEDCMD}\n/^[[:blank:]]*locking_library[[:blank:]]*=.*/d" -- fi -- fi -- - echo -e $SEDCMD > $SCRIPTFILE - sed <$CONFIGFILE >$TMPFILE -f $SCRIPTFILE - if [ $? != 0 ] diff --git a/sys-fs/clvm/files/clvmd.confd b/sys-fs/clvm/files/clvmd.confd new file mode 100644 index 000000000000..0bef40312b7a --- /dev/null +++ b/sys-fs/clvm/files/clvmd.confd @@ -0,0 +1,3 @@ +# CLVMD_CLUSTER_TIMEOUT -- amount of time to wait for cluster quorum. + +CLVMD_CLUSTER_TIMEOUT=30 diff --git a/sys-fs/clvm/files/clvmd.rc b/sys-fs/clvm/files/clvmd.rc index 4222bbb99b0b..be51784a5f17 100755 --- a/sys-fs/clvm/files/clvmd.rc +++ b/sys-fs/clvm/files/clvmd.rc @@ -1,18 +1,21 @@ #!/sbin/runscript # Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-fs/clvm/files/clvmd.rc,v 1.4 2008/03/29 15:42:28 xmerlin Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-fs/clvm/files/clvmd.rc,v 1.5 2008/11/21 23:31:44 xmerlin Exp $ + +[ -x /usr/sbin/clvmd ] && CLVMD_BIN="/usr/sbin/clvmd" || CLVMD_BIN="/sbin/clvmd" + +[ -z "$CLVMD_CLUSTER_TIMEOUT" ] && CLVMD_CLUSTER_TIMEOUT=30 -CLVM_BIN="/sbin/clvmd" VGCHANGE="/sbin/vgchange" VGSCAN="/sbin/vgscan" VGDISPLAY="/sbin/vgdisplay" +CLVMD_PIDFILE="/var/run/clvmd.pid" depend() { use dns logger use net need cman - before gfs } load_modules() { @@ -67,54 +70,39 @@ umount_gfs_filesystems() { fi } -start() { +start_volumes() { + ebegin "Scanning LVM volumes" + $VGSCAN &>/dev/null - local module=$(awk '$1 == "dm_mod" { print $1 }' /proc/{modules,devices}) + ret=$? - if [ -z "${module}" ]; then - load_modules "dm-mod" - sleep 1s - fi - - ebegin "Starting clvmd" - start-stop-daemon --start --quiet --exec ${CLVM_BIN} - eend $? - - ebegin "Scanning LVM volumes" - ${VGSCAN} &>/dev/null - eend $? - - #if [ "$?" -eq 0 ] && [ -x /sbin/vgchange ] && [ -f /etc/lvmtab -o -d /etc/lvm ] - #then - # ebegin "Setting up the Logical Volume Manager" - # /sbin/vgchange -aly >/dev/null - # eend $? "Failed to setup the LVM" - #fi - - if [ -n "$LVM_VGS" ] + if [ "$ret" -eq 5 ] then - for vg in $LVM_VGS - do - ebegin " Activating VG: ${vg} " - $VGCHANGE -ayl ${vg} >/dev/null - eend $? - done + einfo " ...initialization delayed." + eend 0 else - clustervgs=`$VGDISPLAY 2> /dev/null | awk 'BEGIN {RS="VG Name"} {if (/Clustered/) print $1;}'` - for vg in $clustervgs; do - ebegin " Activating Clustered VG: ${vg} " - $VGCHANGE -ayl ${vg} >/dev/null - eend $? - done + eend 0 + + if [ -n "$LVM_VGS" ] + then + for vg in $LVM_VGS + do + ebegin " Activating VG: ${vg} " + $VGCHANGE -ayl ${vg} >/dev/null + eend $? + done + else + clustervgs=`$VGDISPLAY 2> /dev/null | awk 'BEGIN {RS="VG Name"} {if (/Clustered/) print $1;}'` + for vg in $clustervgs; do + ebegin " Activating Clustered VG: ${vg} " + $VGCHANGE -ayl ${vg} >/dev/null + eend $? + done + fi fi } -stop() { - # umount GFS filesystems - umount_gfs_filesystems - - sleep 2 - +stop_volumes() { if [ -n "$LVM_VGS" ] then for vg in $LVM_VGS @@ -132,10 +120,40 @@ stop() { eend $? done fi +} + + +start() { + local module=$(awk '$1 == "dm_mod" { print $1 }' /proc/{modules,devices}) + + if [ -z "${module}" ]; then + load_modules "dm-mod" + sleep 1s + fi + + ebegin "Starting clvmd ($CLVMD_CLUSTER_TIMEOUT seconds)" + + start-stop-daemon --start --quiet --exec ${CLVMD_BIN} -- -T ${CLVMD_CLUSTER_TIMEOUT} + eend $? + + #start_volumes +} + +stop() { + + # umount GFS filesystems + umount_gfs_filesystems + + #stop_volumes ebegin "Stopping clvmd" - #start-stop-daemon --stop -s 9 --quiet --exec ${CLVM_BIN} --name clvmd - killall -TERM ${CLVM_BIN} >/dev/null + #start-stop-daemon --stop -s TERM --quiet --exec ${CLVMD_BIN} --name clvmd + killall -TERM ${CLVMD_BIN} >/dev/null eend $? + #local module=$(awk '$1 == "dm_mod" { print $1 }' /proc/modules) + + #if [[ "$?" -eq 0 && ! -z "${module}" ]]; then + # unload_modules "dm-mod" + #fi } diff --git a/sys-fs/clvm/files/clvmd.rc-2.02.33-xm b/sys-fs/clvm/files/clvmd.rc-2.02.33-xm deleted file mode 100755 index 6e97248c1ae5..000000000000 --- a/sys-fs/clvm/files/clvmd.rc-2.02.33-xm +++ /dev/null @@ -1,146 +0,0 @@ -#!/sbin/runscript -# Copyright 1999-2005 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-fs/clvm/files/clvmd.rc-2.02.33-xm,v 1.1 2008/03/17 19:15:53 xmerlin Exp $ - -CLVM_BIN="/sbin/clvmd" -VGCHANGE="/sbin/vgchange" -VGSCAN="/sbin/vgscan" -VGDISPLAY="/sbin/vgdisplay" - -depend() { - use dns logger - use net - need cman -} - -load_modules() { - local module modules - modules=$1 - - for module in ${modules}; do - ebegin "Loading ${module} kernel module" - modprobe ${module} - eend $? "Failed to load ${module} kernel module" - done -} - -unload_modules() { - local module modules - modules=$1 - - for module in ${modules}; do - ebegin "Unloading ${module} kernel module" - modprobe -r ${module} - eend $? "Failed to unload ${module} kernel module" - done -} - -umount_gfs_filesystems() { - local sig retry - local remaining="$(awk '$3 == "gfs" { print $2 }' /proc/mounts | sort -r)" - - if [ -n "${remaining}" ] - then - sig= - retry=3 - while [ -n "${remaining}" -a "${retry}" -gt 0 ] - do - if [ "${retry}" -lt 3 ] - then - ebegin "Unmounting GFS filesystems (retry)" - umount ${remaining} &>/dev/null - eend $? "Failed to unmount GFS filesystems this retry" - else - ebegin "Unmounting GFS filesystems" - umount ${remaining} &>/dev/null - eend $? "Failed to unmount GFS filesystems" - fi - remaining="$(awk '$3 == "gfs" { print $2 }' /proc/mounts | sort -r)" - [ -z "${remaining}" ] && break - /bin/fuser -k -m ${sig} ${remaining} &>/dev/null - sleep 5 - retry=$((${retry} -1)) - sig=-9 - done - fi -} - -start() { - - local module=$(awk '$1 == "dm_mod" { print $1 }' /proc/{modules,devices}) - - if [ -z "${module}" ]; then - load_modules "dm-mod" - sleep 1s - fi - - ebegin "Starting clvmd" - start-stop-daemon --start --quiet --exec ${CLVM_BIN} - eend $? - - ebegin "Scanning LVM volumes" - ${VGSCAN} &>/dev/null - eend $? - - #if [ "$?" -eq 0 ] && [ -x /sbin/vgchange ] && [ -f /etc/lvmtab -o -d /etc/lvm ] - #then - # ebegin "Setting up the Logical Volume Manager" - # /sbin/vgchange -aly >/dev/null - # eend $? "Failed to setup the LVM" - #fi - - if [ -n "$LVM_VGS" ] - then - for vg in $LVM_VGS - do - ebegin " Activating VG: ${vg} " - $VGCHANGE -ayl ${vg} >/dev/null - eend $? - done - else - clustervgs=`$VGDISPLAY 2> /dev/null | awk 'BEGIN {RS="VG Name"} {if (/Clustered/) print $1;}'` - for vg in $clustervgs; do - ebegin " Activating Clustered VG: ${vg} " - $VGCHANGE -ayl ${vg} >/dev/null - eend $? - done - fi -} - -stop() { - - # umount GFS filesystems - #umount_gfs_filesystems - - #for rtrn in 0 - #do - if [ -n "$LVM_VGS" ] - then - for vg in $LVM_VGS - do - ebegin " Shutting Down VG: ${vg} " - $VGCHANGE -anl ${vg} >/dev/null - eend $? - done - else - # Deactivate only clustered volumes - clustervgs=`$VGDISPLAY 2> /dev/null | awk 'BEGIN {RS="VG Name"} {if (/Clustered/) print $1;}'` - for vg in $clustervgs; do - ebegin " Shutting Down Clustered VG: ${vg} " - $VGCHANGE -anl ${vg} >/dev/null - eend $? - done - fi - - ebegin "Stopping clvmd" - #start-stop-daemon --stop -s 9 --quiet --exec ${CLVM_BIN} --name clvmd - killall -TERM ${CLVM_BIN} >/dev/null - eend $? - - local module=$(awk '$1 == "dm_mod" { print $1 }' /proc/modules) - - if [[ "$?" -eq 0 && ! -z "${module}" ]]; then - unload_modules "dm-mod" - fi -} diff --git a/sys-fs/clvm/files/lvm.confd-2.02.28-r2 b/sys-fs/clvm/files/lvm.confd index 2fbd8668c376..2fbd8668c376 100644 --- a/sys-fs/clvm/files/lvm.confd-2.02.28-r2 +++ b/sys-fs/clvm/files/lvm.confd diff --git a/sys-fs/clvm/files/lvm.rc-2.02.28-r2 b/sys-fs/clvm/files/lvm.rc index 2f64a7f07b30..bef24adb32f9 100644 --- a/sys-fs/clvm/files/lvm.rc-2.02.28-r2 +++ b/sys-fs/clvm/files/lvm.rc @@ -1,7 +1,7 @@ #!/sbin/runscript # Copyright 1999-2007 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-fs/clvm/files/lvm.rc-2.02.28-r2,v 1.1 2008/03/17 19:15:53 xmerlin Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-fs/clvm/files/lvm.rc,v 1.1 2008/11/21 23:31:44 xmerlin Exp $ depend() { if [ -e /lib/librc.so ]; then diff --git a/sys-fs/clvm/files/lvm2-start.sh b/sys-fs/clvm/files/lvm2-start.sh index d367a203cf8b..27ef40f26702 100755 --- a/sys-fs/clvm/files/lvm2-start.sh +++ b/sys-fs/clvm/files/lvm2-start.sh @@ -1,5 +1,5 @@ # /lib/rcscripts/addons/lvm2-start.sh -# $Header: /var/cvsroot/gentoo-x86/sys-fs/clvm/files/lvm2-start.sh,v 1.3 2006/07/13 08:23:55 xmerlin Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-fs/clvm/files/lvm2-start.sh,v 1.4 2008/11/21 23:31:44 xmerlin Exp $ # LVM support for /usr, /home, /opt .... # This should be done *before* checking local @@ -21,7 +21,11 @@ if [[ -z ${CDBOOT} ]] && [[ -x /sbin/vgscan ]] ; then if [[ $? == 0 ]] && [[ -x /sbin/vgchange ]] && \ [[ -f /etc/lvmtab || -d /etc/lvm ]] then - /sbin/vgchange --ignorelockingfailure -a y >/dev/null + noclustervgs=`/sbin/vgdisplay 2> /dev/null | \ + awk 'BEGIN {RS="VG Name"} {if (!/Clustered/) { if ($1 != "---") print $1; } }'` + for vg in $noclustervgs; do + /sbin/vgchange --ignorelockingfailure -a y ${vg} >/dev/null + done fi eend $? "Failed to setup the LVM" fi diff --git a/sys-fs/clvm/files/lvm2-start.sh-2.02.33-xm b/sys-fs/clvm/files/lvm2-start.sh-2.02.33-xm deleted file mode 100644 index df07fa74406d..000000000000 --- a/sys-fs/clvm/files/lvm2-start.sh-2.02.33-xm +++ /dev/null @@ -1,34 +0,0 @@ -# /lib/rcscripts/addons/lvm2-start.sh -# $Header: /var/cvsroot/gentoo-x86/sys-fs/clvm/files/lvm2-start.sh-2.02.33-xm,v 1.1 2008/03/17 19:15:53 xmerlin Exp $ - -# LVM support for /usr, /home, /opt .... -# This should be done *before* checking local -# volumes, or they never get checked. - -# NOTE: Add needed modules for LVM or RAID, etc -# to /etc/modules.autoload if needed -if [[ -z ${CDBOOT} ]] && [[ -x /sbin/vgscan ]] ; then - if [[ -e /proc/modules ]] && \ - ! grep -qs 'device-mapper' /proc/{devices,misc} - then - modprobe dm-mod &>/dev/null - fi - - if [[ -d /proc/lvm ]] || grep -qs 'device-mapper' /proc/{devices,misc} ; then - ebegin "Setting up the Logical Volume Manager" - #still echo stderr for debugging - /sbin/vgscan --mknodes --ignorelockingfailure >/dev/null - if [[ $? == 0 ]] && [[ -x /sbin/vgchange ]] && \ - [[ -f /etc/lvmtab || -d /etc/lvm ]] - then - noclustervgs=`/sbin/vgdisplay 2> /dev/null | \ - awk 'BEGIN {RS="VG Name"} {if (!/Clustered/) { if ($1 != "---") print $1; } }'` - for vg in $noclustervgs; do - /sbin/vgchange --ignorelockingfailure -a y ${vg} >/dev/null - done - fi - eend $? "Failed to setup the LVM" - fi -fi - -# vim:ts=4 diff --git a/sys-fs/clvm/files/lvm2-stop.sh b/sys-fs/clvm/files/lvm2-stop.sh index 252c52d3b32b..c7f979c1d3a1 100755 --- a/sys-fs/clvm/files/lvm2-stop.sh +++ b/sys-fs/clvm/files/lvm2-stop.sh @@ -1,5 +1,5 @@ # /lib/rcscripts/addons/lvm2-stop.sh -# $Header: /var/cvsroot/gentoo-x86/sys-fs/clvm/files/lvm2-stop.sh,v 1.3 2006/07/13 08:23:55 xmerlin Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-fs/clvm/files/lvm2-stop.sh,v 1.4 2008/11/21 23:31:44 xmerlin Exp $ # Stop LVM2 if [ -x /sbin/vgchange ] && \ diff --git a/sys-fs/clvm/files/lvm2-stop.sh-2.02.33-xm b/sys-fs/clvm/files/lvm2-stop.sh-2.02.33-xm deleted file mode 100755 index fa69533d51ae..000000000000 --- a/sys-fs/clvm/files/lvm2-stop.sh-2.02.33-xm +++ /dev/null @@ -1,61 +0,0 @@ -# /lib/rcscripts/addons/lvm2-stop.sh -# $Header: /var/cvsroot/gentoo-x86/sys-fs/clvm/files/lvm2-stop.sh-2.02.33-xm,v 1.1 2008/03/17 19:15:53 xmerlin 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 - - ROOT_DEVICE=`mount|grep " / "|awk '{print $1}'` - 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 |