summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Zoffoli <xmerlin@gentoo.org>2005-03-25 02:17:29 +0000
committerChristian Zoffoli <xmerlin@gentoo.org>2005-03-25 02:17:29 +0000
commitdc6ee26cc87e598648407f86b8600f4f2c2c8375 (patch)
tree615ae31fa51aac824c6a740d96776e11770e44ef /sys-cluster/dlm/files/dlm.rc
parentAdded spanish description to the category metadata (diff)
downloadhistorical-dc6ee26cc87e598648407f86b8600f4f2c2c8375.tar.gz
historical-dc6ee26cc87e598648407f86b8600f4f2c2c8375.tar.bz2
historical-dc6ee26cc87e598648407f86b8600f4f2c2c8375.zip
improved init script
Package-Manager: portage-2.0.51.19
Diffstat (limited to 'sys-cluster/dlm/files/dlm.rc')
-rwxr-xr-xsys-cluster/dlm/files/dlm.rc44
1 files changed, 27 insertions, 17 deletions
diff --git a/sys-cluster/dlm/files/dlm.rc b/sys-cluster/dlm/files/dlm.rc
index c40a3f886af4..36f4750c9d49 100755
--- a/sys-cluster/dlm/files/dlm.rc
+++ b/sys-cluster/dlm/files/dlm.rc
@@ -1,7 +1,7 @@
#!/sbin/runscript
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-cluster/dlm/files/dlm.rc,v 1.2 2005/03/23 14:39:02 xmerlin Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-cluster/dlm/files/dlm.rc,v 1.3 2005/03/25 02:14:00 xmerlin Exp $
depend() {
use net
@@ -9,35 +9,45 @@ depend() {
provide cluster-locking-manager
}
+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
+}
+
start() {
ebegin "Loading dlm module"
- modprobe dlm
+ load_modules dlm
eend $?
}
stop() {
- local module modules
+ local modules
if [ -d /proc/cluster/lock_dlm ]; then
modules="${modules} lock_dlm"
fi
- if [ -d /proc/cluster/dlm_dir ]; then
+ if [ -d /proc/cluster/config/dlm ]; then
modules="${modules} dlm"
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
+ unload_modules ${modules}
}