Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 330295 - sys-cluster/drbd-all-version RC scripts fail to stop() when drbd is built in the kernel and not as a module
Summary: sys-cluster/drbd-all-version RC scripts fail to stop() when drbd is built in...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Cluster Team
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks:
 
Reported: 2010-07-29 01:18 UTC by Anthony Basile
Modified: 2010-09-10 18:51 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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
+