summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Zoffoli <xmerlin@gentoo.org>2005-03-01 12:11:40 +0000
committerChristian Zoffoli <xmerlin@gentoo.org>2005-03-01 12:11:40 +0000
commit320fda595d00838b6419517c3a6dd011d6dcf126 (patch)
treebcf4882da8684c33d8cbd88345bf2db8f780725d /sys-cluster/drbd
parentNew version (Manifest recommit) (diff)
downloadgentoo-2-320fda595d00838b6419517c3a6dd011d6dcf126.tar.gz
gentoo-2-320fda595d00838b6419517c3a6dd011d6dcf126.tar.bz2
gentoo-2-320fda595d00838b6419517c3a6dd011d6dcf126.zip
improved init script (now it works better with udev)
(Portage version: 2.0.51-r15)
Diffstat (limited to 'sys-cluster/drbd')
-rw-r--r--sys-cluster/drbd/ChangeLog5
-rwxr-xr-xsys-cluster/drbd/files/drbd-0.7-init29
2 files changed, 29 insertions, 5 deletions
diff --git a/sys-cluster/drbd/ChangeLog b/sys-cluster/drbd/ChangeLog
index 80ee8e315e7e..51025330ad1a 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.24 2005/02/28 00:46:33 xmerlin Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-cluster/drbd/ChangeLog,v 1.25 2005/03/01 12:11:40 xmerlin Exp $
+
+ 01 Mar 2005; Christian Zoffoli <xmerlin@gentoo.org> files/drbd-0.7-init:
+ improved init script (now it works better with udev)
23 Feb 2005; Christian Zoffoli <xmerlin@gentoo.org> drbd-0.7.10.ebuild:
drbd-0.7.10 marked stable on x86
diff --git a/sys-cluster/drbd/files/drbd-0.7-init b/sys-cluster/drbd/files/drbd-0.7-init
index 0c669cebeaf3..033884a35626 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.2 2005/01/15 21:01:01 xmerlin Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-cluster/drbd/files/drbd-0.7-init,v 1.3 2005/03/01 12:11:40 xmerlin Exp $
opts="${opts} reload"
@@ -9,6 +9,7 @@ DRBDADM="/sbin/drbdadm"
PROC_DRBD="/proc/drbd"
MODPROBE="modprobe"
RMMOD="rmmod"
+ADD_MOD_PARAM=""
depend() {
use logger
@@ -17,12 +18,32 @@ depend() {
need net
}
-start() {
- ebegin "Starting DRBD"
+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 [ ! -f ${DEVICE} ]; then
+ mknod $DEVICE b 147 ${RESOURCE/drbd/}
+ fi
+ done
+}
+load_module() {
if [ ! -f $PROC_DRBD ]; then
- modprobe drbd &> /dev/null
+ ${MODPROBE} -s drbd `$DRBDADM sh-mod-parms` $ADD_MOD_PARAM &> /dev/null
fi
+}
+
+start() {
+ ebegin "Starting DRBD"
+
+ load_module
+ create_devices
${DRBDADM} up all
eend $ret