Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 330295

Summary: sys-cluster/drbd-all-version RC scripts fail to stop() when drbd is built in the kernel and not as a module
Product: Gentoo Linux Reporter: Anthony Basile <blueness>
Component: Current packagesAssignee: Gentoo Cluster Team <cluster>
Status: RESOLVED FIXED    
Severity: normal Keywords: InVCS
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Anthony Basile gentoo-dev 2010-07-29 01:18:52 UTC
The stop() function in drbd-0.7.rc and drbd-8.0.rc assume that drbd was built as a module and so issues an unqualified ${RMMOD} drbd.  This fails if drbd was build in the kernel and not as a module.

This is easily fixed with the following check (for drbd-0.8.rc)

--- drbd-8.0.rc.orig	2010-07-29 01:12:28.424921274 +0000
+++ drbd-8.0.rc	2010-07-29 01:13:19.936773296 +0000
@@ -118,7 +118,9 @@
 		if [ -e ${PROC_DRBD} ]; then
 			${DRBDADM} down all
 			sleep 3
-			${RMMOD} drbd
+			if grep -q '^drbd' /proc/modules ; then
+				${RMMOD} drbd
+			fi
 		fi
 		ret=$?
 		eend $ret
Comment 1 Kacper Kowalik (Xarthisius) (RETIRED) gentoo-dev 2010-08-02 04:42:46 UTC
+  02 Aug 2010; Kacper Kowalik <xarthisius@gentoo.org> files/drbd-0.7.rc,
+  files/drbd-8.0.rc:
+  Check if drbd was built as a module before removing it. Fixes bug 330295.
+  Thanks to Anthony Basile <blueness@gentoo.org> for the patch
+