summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Zoffoli <xmerlin@gentoo.org>2005-03-25 02:14:00 +0000
committerChristian Zoffoli <xmerlin@gentoo.org>2005-03-25 02:14:00 +0000
commitb52de235aa27c83d3027a977edb2d61ebb78a443 (patch)
treecb9e913d08593c0800b3fdcef14d3e36f68837db /sys-cluster/dlm
parentVersion bump. (diff)
downloadgentoo-2-b52de235aa27c83d3027a977edb2d61ebb78a443.tar.gz
gentoo-2-b52de235aa27c83d3027a977edb2d61ebb78a443.tar.bz2
gentoo-2-b52de235aa27c83d3027a977edb2d61ebb78a443.zip
improved init script
(Portage version: 2.0.51.19)
Diffstat (limited to 'sys-cluster/dlm')
-rw-r--r--sys-cluster/dlm/ChangeLog5
-rwxr-xr-xsys-cluster/dlm/files/dlm.rc44
2 files changed, 31 insertions, 18 deletions
diff --git a/sys-cluster/dlm/ChangeLog b/sys-cluster/dlm/ChangeLog
index dd6d01018327..15ec76d5f709 100644
--- a/sys-cluster/dlm/ChangeLog
+++ b/sys-cluster/dlm/ChangeLog
@@ -1,6 +1,9 @@
# ChangeLog for sys-cluster/dlm
# Copyright 1999-2005 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-cluster/dlm/ChangeLog,v 1.9 2005/03/23 14:39:02 xmerlin Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-cluster/dlm/ChangeLog,v 1.10 2005/03/25 02:14:00 xmerlin Exp $
+
+ 25 Mar 2005; Christian Zoffoli <xmerlin@gentoo.org> files/dlm.rc:
+ improved init script
23 Mar 2005; Christian Zoffoli <xmerlin@gentoo.org> files/dlm.rc:
added lock_dlm module unload in init
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}
}