summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Zoffoli <xmerlin@gentoo.org>2005-03-22 13:59:10 +0000
committerChristian Zoffoli <xmerlin@gentoo.org>2005-03-22 13:59:10 +0000
commit2a34578591da8b0a5457bb0799c3dd3765b6f6b3 (patch)
tree0ef636a4a2c7d1f63a1787751c569d20a5df88c8 /sys-fs/gfs
parentimproved init/conf (diff)
downloadhistorical-2a34578591da8b0a5457bb0799c3dd3765b6f6b3.tar.gz
historical-2a34578591da8b0a5457bb0799c3dd3765b6f6b3.tar.bz2
historical-2a34578591da8b0a5457bb0799c3dd3765b6f6b3.zip
improved init, removed old fiiles/{gfs,gfs-mount}
Package-Manager: portage-2.0.51.19
Diffstat (limited to 'sys-fs/gfs')
-rw-r--r--sys-fs/gfs/ChangeLog6
-rw-r--r--sys-fs/gfs/Manifest15
-rwxr-xr-xsys-fs/gfs/files/gfs45
-rwxr-xr-xsys-fs/gfs/files/gfs-mount28
-rwxr-xr-xsys-fs/gfs/files/gfs.rc124
-rw-r--r--sys-fs/gfs/gfs-6.1_pre21.ebuild6
6 files changed, 138 insertions, 86 deletions
diff --git a/sys-fs/gfs/ChangeLog b/sys-fs/gfs/ChangeLog
index f3425b38ed9a..40b23c6807ae 100644
--- a/sys-fs/gfs/ChangeLog
+++ b/sys-fs/gfs/ChangeLog
@@ -1,6 +1,10 @@
# ChangeLog for sys-fs/gfs
# Copyright 1999-2005 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-fs/gfs/ChangeLog,v 1.3 2005/03/20 13:22:04 swegener Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-fs/gfs/ChangeLog,v 1.4 2005/03/22 13:59:10 xmerlin Exp $
+
+ 22 Mar 2005; Christian Zoffoli <xmerlin@gentoo.org> -files/gfs,
+ -files/gfs-mount, +files/gfs.rc, gfs-6.1_pre21.ebuild:
+ improved init, removed old fiiles/{gfs,gfs-mount}
19 Mar 2005; Christian Zoffoli <xmerlin@gentoo.org> files/gfs,
gfs-6.1_pre21.ebuild:
diff --git a/sys-fs/gfs/Manifest b/sys-fs/gfs/Manifest
index 577b2c64dc9d..4ec6a5754156 100644
--- a/sys-fs/gfs/Manifest
+++ b/sys-fs/gfs/Manifest
@@ -1,16 +1,15 @@
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
-MD5 e8f08f009334ac9d35483eaed7f04c25 gfs-6.1_pre21.ebuild 1615
-MD5 1c18a568928acfecec80d7ac7c2bc306 ChangeLog 750
+MD5 52b14eab0b0016d98c6200be45d3b482 ChangeLog 925
+MD5 816e1b389a361d9c9f0e2f405a3d2876 gfs-6.1_pre21.ebuild 1602
MD5 a64b9a1937a5cfc2fbaf373521f65d47 metadata.xml 223
-MD5 031d2d4a8cf06aad5033713cd9aa2dbb files/gfs 908
-MD5 b61c5aba640725d80ee0d9a1ca9998c8 files/gfs-mount 797
MD5 8b61a396206c23d7fb8e1adad649f8b7 files/digest-gfs-6.1_pre21 65
+MD5 d6b5360d2bc419dc2b0872415e42c39d files/gfs.rc 2874
-----BEGIN PGP SIGNATURE-----
-Version: GnuPG v1.4.1 (GNU/Linux)
+Version: GnuPG v1.2.6 (GNU/Linux)
-iD8DBQFCPXkFI1lqEGTUzyQRAnKeAKCWfIhlXvkL71+GpF2MU+hp7rPLUwCgqqd6
-AfLKtUZCU5FpOGa6yMZ8DsQ=
-=MGTi
+iD8DBQFCQCUogMUyd/cdjWsRAj3/AJ9An09cVqVWp51Jg3rJ2uayK4qrUACfWYCx
+dzn1IhmEMNtx2WucYz9vPpU=
+=Lr66
-----END PGP SIGNATURE-----
diff --git a/sys-fs/gfs/files/gfs b/sys-fs/gfs/files/gfs
deleted file mode 100755
index b06319b41bec..000000000000
--- a/sys-fs/gfs/files/gfs
+++ /dev/null
@@ -1,45 +0,0 @@
-#!/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-fs/gfs/files/gfs,v 1.2 2005/03/19 22:04:36 xmerlin Exp $
-
-depend() {
- provide cluster
- need net
- need ccs fenced
- after cman
- use dns logger
-}
-
-checkconfig() {
- if [ ! -f /etc/ntp.conf ] ; then
- eerror "Please create /etc/ntp.conf"
- eerror "Sample conf: /usr/share/ntp/ntp.conf"
- return 1
- fi
- return 0
-}
-
-start() {
- checkconfig || return $?
-
- einfo "Starting gfs cluster:"
- ebegin "Loading needed kernel modules"
-
- if [ ! -f /proc/cluster/lock_dlm ]; then
- modprobe lock_dlm
- fi
- if [ ! -f /proc/fs/gfs ]; then
- modprobe gfs
- fi
- eend $? "Failed to load needed kernel modules"
-
-}
-
-stop() {
- einfo "Stopping gfs cluster:"
- ebegin "Removing gfs module"
- modprobe -r gfs &>/dev/null
- eend $?
-
-}
diff --git a/sys-fs/gfs/files/gfs-mount b/sys-fs/gfs/files/gfs-mount
deleted file mode 100755
index 739afd76cc5f..000000000000
--- a/sys-fs/gfs/files/gfs-mount
+++ /dev/null
@@ -1,28 +0,0 @@
-#!/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-fs/gfs/files/gfs-mount,v 1.1 2005/03/19 17:32:19 xmerlin Exp $
-
-depend() {
- need net
- after gnbd-client gfs
- use dns logger
-}
-
-start() {
- GFS=`cat /etc/fstab | grep 'gfs'`
- if [ -n "$GFS" ] ; then
- ebegin "Mounting all gfs filesystems"
- cat /etc/fstab | awk '/[\t\s]gfs[\t\s]/ { print $1,$2 }' | xargs mount -v -t gfs
- eend $? "Failed to mount all gfs filesystems"
- fi
-}
-
-stop() {
- GFS=`cat /etc/fstab | grep 'gfs'`
- if [ -n "$GFS" ] ; then
- ebegin "Unmounting all gfs filesystems"
- cat /etc/fstab | awk '/[\t\s]gfs[\t\s]/ { print $2 }' | xargs umount -v -t gfs
- eend $? "Failed to umount all gfs filesystems"
- fi
-}
diff --git a/sys-fs/gfs/files/gfs.rc b/sys-fs/gfs/files/gfs.rc
new file mode 100755
index 000000000000..74f83ef3e730
--- /dev/null
+++ b/sys-fs/gfs/files/gfs.rc
@@ -0,0 +1,124 @@
+#!/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-fs/gfs/files/gfs.rc,v 1.1 2005/03/22 13:59:10 xmerlin Exp $
+
+depend() {
+ use dns logger
+ use net gnbd-client
+ need cluster-manager cluster-locking-manager fenced
+ provide cluster
+}
+
+start() {
+ einfo "Starting gfs cluster:"
+
+ if [ ! -f /etc/ntp.conf ] ; then
+ eerror "Please create /etc/ntp.conf"
+ eerror "Sample conf: /usr/share/ntp/ntp.conf"
+ eend 1
+ fi
+
+ local module
+
+ # detect cluster/locking manager cman+dlm or gulm ?
+ if [ -d /proc/cluster/config/cman ]; then
+ if [ ! -d /proc/cluster/lock_dlm ]; then
+ modules="${modules} lock_dlm"
+ fi
+ else
+ if [ ! -d /proc/cluster/lock_gulm ]; then
+ modules="${modules} lock_gulm"
+ fi
+ fi
+
+ if [ ! -f /proc/fs/gfs ]; then
+ modules="${modules} gfs"
+ fi
+
+ for module in ${modules}; do
+ ebegin "Loading ${module} kernel module"
+ modprobe ${module}
+
+ if [ "$?" -ne 0 ]
+ then
+ ewend 1 "Failed to load ${module} kernel module"
+ else
+ eend 0
+ fi
+ done
+
+ ebegin "Mounting GFS filesystems"
+ mount -at gfs >/dev/null
+
+ if [ "$?" -ne 0 ]
+ then
+ ewend 1 "Could not mount all GFS filesystems!"
+ else
+ eend 0
+ fi
+
+ return 0
+}
+
+stop() {
+ einfo "Stopping gfs cluster:"
+
+ local sig retry
+ local remaining="$(awk '$3 ~ /gfs/ { if ($2 != "/") print $2 }' /proc/mounts | sort -r)"
+
+ if [ -z "${remaining}" ]
+ then
+ ebegin "Unmounting GFS filesystems"
+ 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/ { 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 module modules
+
+ if [ -f /proc/fs/gfs ]; then
+ modules="gfs"
+ fi
+ if [ -d /proc/cluster/lock_dlm ]; then
+ modules="${modules} lock_dlm"
+ fi
+ if [ -d /proc/cluster/lock_gulm ]; then
+ modules="${modules} lock_gulm"
+ fi
+
+ local module
+ for module in ${modules}; do
+ ebegin "Unloading ${module} kernel module"
+ modprobe -r ${module}
+
+ if [ "$?" -ne 0 ]
+ then
+ ewend 1 "Failed to unload ${module} kernel module"
+ else
+ eend 0
+ fi
+ done
+
+ return 0
+}
diff --git a/sys-fs/gfs/gfs-6.1_pre21.ebuild b/sys-fs/gfs/gfs-6.1_pre21.ebuild
index f857e0dc61fa..032ff564a194 100644
--- a/sys-fs/gfs/gfs-6.1_pre21.ebuild
+++ b/sys-fs/gfs/gfs-6.1_pre21.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-fs/gfs/gfs-6.1_pre21.ebuild,v 1.2 2005/03/19 22:04:36 xmerlin Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-fs/gfs/gfs-6.1_pre21.ebuild,v 1.3 2005/03/22 13:59:10 xmerlin Exp $
inherit linux-mod
@@ -46,9 +46,7 @@ src_compile() {
src_install() {
make DESTDIR=${D} install || die
- exeinto /etc/init.d
- doexe ${FILESDIR}/gfs
- doexe ${FILESDIR}/gfs-mount
+ exeinto /etc/init.d ; newexe ${FILESDIR}/gfs.rc gfs || die
}
pkg_postinst() {