summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Zoffoli <xmerlin@gentoo.org>2005-03-23 14:09:48 +0000
committerChristian Zoffoli <xmerlin@gentoo.org>2005-03-23 14:09:48 +0000
commitf9ca5d38f221f0dde93517930745072c4149d0e6 (patch)
treea967811733ee7293753d49c8263beced675d98c0 /sys-cluster/gnbd
parentfix compile error for ppc (#86023) (diff)
downloadgentoo-2-f9ca5d38f221f0dde93517930745072c4149d0e6.tar.gz
gentoo-2-f9ca5d38f221f0dde93517930745072c4149d0e6.tar.bz2
gentoo-2-f9ca5d38f221f0dde93517930745072c4149d0e6.zip
added unmounting gfs capability to gnbd-client script
(Portage version: 2.0.51.19)
Diffstat (limited to 'sys-cluster/gnbd')
-rw-r--r--sys-cluster/gnbd/ChangeLog5
-rwxr-xr-xsys-cluster/gnbd/files/gnbd-client.rc35
2 files changed, 38 insertions, 2 deletions
diff --git a/sys-cluster/gnbd/ChangeLog b/sys-cluster/gnbd/ChangeLog
index 7b00859b3a7f..3b090ac51f91 100644
--- a/sys-cluster/gnbd/ChangeLog
+++ b/sys-cluster/gnbd/ChangeLog
@@ -1,6 +1,9 @@
# ChangeLog for sys-cluster/gnbd
# Copyright 1999-2005 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-cluster/gnbd/ChangeLog,v 1.1 2005/03/23 02:34:44 xmerlin Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-cluster/gnbd/ChangeLog,v 1.2 2005/03/23 14:09:48 xmerlin Exp $
+
+ 23 Mar 2005; Christian Zoffoli <xmerlin@gentoo.org> files/gnbd-client.rc:
+ added unmounting gfs capability to gnbd-client script
*gnbd-1.0_pre13 (23 Mar 2005)
diff --git a/sys-cluster/gnbd/files/gnbd-client.rc b/sys-cluster/gnbd/files/gnbd-client.rc
index 95c51fee400c..12ae6cb637c5 100755
--- a/sys-cluster/gnbd/files/gnbd-client.rc
+++ b/sys-cluster/gnbd/files/gnbd-client.rc
@@ -1,7 +1,7 @@
#!/sbin/runscript
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License, v2 or later
-# $Header: /var/cvsroot/gentoo-x86/sys-cluster/gnbd/files/gnbd-client.rc,v 1.1 2005/03/23 02:34:44 xmerlin Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-cluster/gnbd/files/gnbd-client.rc,v 1.2 2005/03/23 14:09:48 xmerlin Exp $
depend() {
use dns logger
@@ -31,6 +31,39 @@ start() {
stop() {
+ local sig retry
+ local remaining="$(awk '$3 ~ /gfs/ && $1 ~ /\/dev\/gnbd\// { if ($2 != "/") print $2 }' /proc/mounts | sort -r)"
+
+ if [ -z "${remaining}" ]
+ then
+ ebegin "Unmounting GFS filesystems (GNBDs imported devices)"
+ eend 0
+ else
+ 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/ && $1 ~ /\/dev\/gnbd\// { if ($2 != "/") 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
+
+
+
local GNBD_MONITOR_PROC
ebegin "Unimporting all GNBDs devices"