summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Zoffoli <xmerlin@gentoo.org>2005-03-15 03:42:49 +0000
committerChristian Zoffoli <xmerlin@gentoo.org>2005-03-15 03:42:49 +0000
commit147e3c43fc530d7a0a8593a0bc81a1f5b0c2b6b2 (patch)
treefb50d8b6300dc2ccf1c6eba6cd990e1909046ed4 /sys-cluster
parentMove metalog.conf to plain old /etc/. (diff)
downloadhistorical-147e3c43fc530d7a0a8593a0bc81a1f5b0c2b6b2.tar.gz
historical-147e3c43fc530d7a0a8593a0bc81a1f5b0c2b6b2.tar.bz2
historical-147e3c43fc530d7a0a8593a0bc81a1f5b0c2b6b2.zip
better device handling in a udev env.
Package-Manager: portage-2.0.51.19
Diffstat (limited to 'sys-cluster')
-rw-r--r--sys-cluster/drbd/ChangeLog5
-rw-r--r--sys-cluster/drbd/Manifest10
-rwxr-xr-xsys-cluster/drbd/files/drbd-0.7-init41
3 files changed, 27 insertions, 29 deletions
diff --git a/sys-cluster/drbd/ChangeLog b/sys-cluster/drbd/ChangeLog
index 6196830b6883..8ae012c38f4d 100644
--- a/sys-cluster/drbd/ChangeLog
+++ b/sys-cluster/drbd/ChangeLog
@@ -1,6 +1,9 @@
# ChangeLog for sys-cluster/drbd
# Copyright 2002-2005 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-cluster/drbd/ChangeLog,v 1.28 2005/03/13 13:35:30 xmerlin Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-cluster/drbd/ChangeLog,v 1.29 2005/03/15 03:42:49 xmerlin Exp $
+
+ 15 Mar 2005; Christian Zoffoli <xmerlin@gentoo.org> files/drbd-0.7-init:
+ better device handling in a udev env.
13 Mar 2005; Christian Zoffoli <xmerlin@gentoo.org> files/drbd-0.7-init:
fixed device check/creation closed bug #84871, thanks to joram agten
diff --git a/sys-cluster/drbd/Manifest b/sys-cluster/drbd/Manifest
index 9620f70390e8..53c5e43882d4 100644
--- a/sys-cluster/drbd/Manifest
+++ b/sys-cluster/drbd/Manifest
@@ -1,7 +1,7 @@
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
-MD5 e4a06781a8c68a55d7967c22f42b36e0 ChangeLog 5409
+MD5 30d34eab226a4c64149a995496d696d6 ChangeLog 5525
MD5 a64b9a1937a5cfc2fbaf373521f65d47 metadata.xml 223
MD5 1f4fc97c6b0ebe088c103071f8bcad82 drbd-0.6.12-r1.ebuild 2150
MD5 d76b2aed9c6bb9b15baa7b1d8195c2f0 drbd-0.7.10.ebuild 2182
@@ -11,13 +11,13 @@ MD5 7416c44daab264a36cc8c5a2c35e757f files/0.6.12-scripts-Makefile.patch 1072
MD5 52dc2e272f064349f8f70277159d4a5f files/0.6.12-module-Makefile.patch 776
MD5 3959588a14b9fba5df432a29d00fa63f files/digest-drbd-0.6.12-r1 63
MD5 f8ceed0b6be2ded4cdb079d38ac0c3d0 files/0.6.12-Makefile.vars.patch 675
-MD5 563859250083021b2005d75b1686128c files/drbd-0.7-init 1601
+MD5 3c8f8e6ea02cda5bee2a5e3bc8731774 files/drbd-0.7-init 1627
MD5 cc42f194896b14c87944e9a5c5aaebf9 files/drbd-0.7-module-Makefile.patch 948
MD5 96f405e763a4e7f0735cedc0277c3703 files/digest-drbd-0.7.10 63
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (GNU/Linux)
-iD8DBQFCNEGUgMUyd/cdjWsRAu7GAJ9Lxur18RNZJl+ZwgLnX1It9JswrACfbuUK
-QN6OIOipGVa+4EJKDbBqqyM=
-=9J/j
+iD8DBQFCNlnXgMUyd/cdjWsRApLgAKCBG/a4MDu2qTwbaHjfANRyzZxoJACeOcJS
+q8HxmNY+mrkMDN6sCaP41y8=
+=WzP0
-----END PGP SIGNATURE-----
diff --git a/sys-cluster/drbd/files/drbd-0.7-init b/sys-cluster/drbd/files/drbd-0.7-init
index 02e3bba1519c..3b105913f0e8 100755
--- a/sys-cluster/drbd/files/drbd-0.7-init
+++ b/sys-cluster/drbd/files/drbd-0.7-init
@@ -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/drbd/files/drbd-0.7-init,v 1.4 2005/03/13 13:35:30 xmerlin Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-cluster/drbd/files/drbd-0.7-init,v 1.5 2005/03/15 03:42:49 xmerlin Exp $
opts="${opts} reload"
@@ -9,6 +9,7 @@ DRBDADM="/sbin/drbdadm"
PROC_DRBD="/proc/drbd"
MODPROBE="modprobe"
RMMOD="rmmod"
+UDEV_TIMEOUT=10
ADD_MOD_PARAM=""
depend() {
@@ -18,33 +19,26 @@ depend() {
need net
}
-create_devices() {
- local RESOURCES RESOURCE DEVICE
-
- # create dev if needed
- RESOURCES=`$DRBDADM sh-resources`
- #RESOURCES=${RESOURCE%%\ *}
-
- for RESOURCE in $RESOURCES; do
- DEVICE=`$DRBDADM sh-dev $RESOURCE`
- if [ ! -b ${DEVICE} ]; then
- mknod $DEVICE b 147 ${DEVICE/\/dev\/drbd\/}
- fi
- done
-}
load_module() {
- if [ ! -f $PROC_DRBD ]; then
- ${MODPROBE} -s drbd `$DRBDADM sh-mod-parms` $ADD_MOD_PARAM &> /dev/null
+ if [ ! -f ${PROC_DRBD} ]; then
+ ${MODPROBE} -s drbd `${DRBDADM} sh-mod-parms` ${ADD_MOD_PARAM} &> /dev/null
fi
+
+ # make sure udev has time to create the device files
+ RESOURCE=`${DRBDADM} sh-resources` || exit 20
+ RESOURCE=${RESOURCE%%\ *}
+ DEVICE=`${DRBDADM} sh-dev ${RESOURCE}` || exit 20
+
+ while [ ! -e ${DEVICE} ] && [ ${UDEV_TIMEOUT} -gt 0 ] ; do
+ sleep 1
+ UDEV_TIMEOUT=$(( ${UDEV_TIMEOUT}-1 ))
+ done
}
start() {
ebegin "Starting DRBD"
-
load_module
- create_devices
-
${DRBDADM} up all
eend $ret
}
@@ -54,8 +48,9 @@ stop() {
# Check for mounted drbd devices
if ! grep -q '^/dev/drbd' /proc/mounts &>/dev/null; then
- if [ -f $PROC_DRBD ]; then
+ if [ -f ${PROC_DRBD} ]; then
${DRBDADM} down all
+ ${RMMOD} drbd
fi
eend $?
else
@@ -68,9 +63,9 @@ status() {
# NEEDS to be heartbeat friendly...
# so: put some "OK" in the output.
ebegin "Status of DRBD"
- if [ -e $PROC_DRBD ]; then
+ if [ -e ${PROC_DRBD} ]; then
echo "drbd driver OK; device status:"
- cat "$PROC_DRBD"
+ cat "${PROC_DRBD}"
eend 0
else
echo >&2 "drbd not loaded"