Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 409931 - sys-block/open-iscsi initscript relies on -l option to modprobe not present in sys-apps/kmod
Summary: sys-block/open-iscsi initscript relies on -l option to modprobe not present i...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
: 453488 468290 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-03-27 22:44 UTC by Thomas Kear
Modified: 2013-08-05 06:21 UTC (History)
6 users (show)

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 Thomas Kear 2012-03-27 22:44:15 UTC
With sys-apps/kmod having replaced sys-apps/module-init-tools on my system the -l option to modprobe that open-iscsi's initscript depends on appears to no longer be present, causing this error when running '/etc/init.d/iscsid start':

iscsid           | * Checking open-iSCSI configuration ...
iscsid           | * Loading iSCSI modules ...
iscsid           |modprobe: invalid option -- 'l'
iscsid           | * Loading libiscsi: not found ...
[ !! ]           |
iscsid           | * ERROR: iscsid failed to start

(from this line)
/etc/init.d/iscsid:55:       if [ -n "$(modprobe -l | grep ${m})" ]

While the man pages installed by kmod do not suggest a replacement, 'modprobe -nq ${m}' appears to work for this purpose, returning exit status 1 for missing modules and 0 for loadable or already loaded.  The module-init-tools version of modprobe exhibits the same behaviour so it should be a safe fix for systems with either.
Comment 1 Julien Sanchez archtester 2012-06-12 12:25:19 UTC
Confirmed.

sys-block/open-iscsi-2.0.872-r1 was built with the following:
USE="(multilib) -debug -slp"


sys-apps/kmod-8 was built with the following:
USE="(multilib) tools zlib -debug -doc -lzma -static-libs"
Comment 2 Julien Sanchez archtester 2012-06-18 11:27:04 UTC
As said in comment #1,

--- iscsid.orig	2012-06-18 13:19:55.243696604 +0200
+++ iscsid	2012-06-18 13:22:28.714753575 +0200
@@ -40,7 +40,7 @@
 	modopts="$@"
 	for m in ${modules}
 	do
-		if [ -n "$(modprobe -l | grep ${m})" ]
+		if modprobe --show --quiet "${m}"
 		then
 			ebegin "${msg} ${m}"
 			modprobe ${modopts} ${m}

fixes this issue.
Comment 3 Xiang Zhai 2012-09-04 01:43:23 UTC
or add function fmod() { 

[ "$1" = '' ] && find /lib/modules/$(uname -r) -iname *.ko -print | awk -F $(uname -r)/ '{print $NF}' 

[ "$1" != '' ] && find /lib/modules/$(uname -r) -iname "$1".ko -print | awk -F $(uname -r)/ '{print $NF}' 

}

then 
- if [ -n "$(modprobe -l | grep ${m})" ]
+ if [ -n "$(fmod | grep ${m})" ]

forum thread - Where'd modprobe -l go? http://forums.gentoo.org/viewtopic-t-934554-start-0-postdays-0-postorder-asc-highlight-.html
Comment 4 Doug Goldstein (RETIRED) gentoo-dev 2012-10-22 16:14:39 UTC
(In reply to comment #3)
> or add function fmod() { 
> 
> [ "$1" = '' ] && find /lib/modules/$(uname -r) -iname *.ko -print | awk -F
> $(uname -r)/ '{print $NF}' 
> 
> [ "$1" != '' ] && find /lib/modules/$(uname -r) -iname "$1".ko -print | awk
> -F $(uname -r)/ '{print $NF}' 
> 
> }
> 
> then 
> - if [ -n "$(modprobe -l | grep ${m})" ]
> + if [ -n "$(fmod | grep ${m})" ]
> 
> forum thread - Where'd modprobe -l go?
> http://forums.gentoo.org/viewtopic-t-934554-start-0-postdays-0-postorder-asc-
> highlight-.html

That's not even remotely correct. modprobe -l showed the list of modules loaded. Not the list of modules available to load.
Comment 5 SpanKY gentoo-dev 2012-10-27 19:22:02 UTC
(In reply to comment #4)

a long time ago you could use modprobe to list all available modules, but they broke it and not many people noticed :(
Comment 6 Alexander Tsoy 2013-01-09 11:52:48 UTC
> (In reply to comment #3)
> That's not even remotely correct. modprobe -l showed the list of modules
> loaded. Not the list of modules available to load.

No. modprobe -l lists *available* modules.

(In reply to comment #5)
> 
> a long time ago you could use modprobe to list all available modules, but
> they broke it and not many people noticed :(

modprobe(8) man page says

       -l --list
              List all modules matching the given wildcard (or "*" if no wild‐
              card is given).  This option is provided for backwards  compati‐
              bility  and  may  go away in future: see find(1) and basename(1)
              for a more flexible alternative.(In reply to comment #4)

*and  may  go away in future*
Comment 7 Doug Goldstein (RETIRED) gentoo-dev 2013-01-22 14:53:19 UTC
*** Bug 453488 has been marked as a duplicate of this bug. ***
Comment 8 Sergey Popov gentoo-dev 2013-01-23 05:19:53 UTC
(In reply to comment #2)
> --- iscsid.orig	2012-06-18 13:19:55.243696604 +0200
> +++ iscsid	2012-06-18 13:22:28.714753575 +0200
> @@ -40,7 +40,7 @@
>  	modopts="$@"
>  	for m in ${modules}
>  	do
> -		if [ -n "$(modprobe -l | grep ${m})" ]
> +		if modprobe --show --quiet "${m}"
>  		then
>  			ebegin "${msg} ${m}"
>  			modprobe ${modopts} ${m}
> 
> fixes this issue.

Looks good. @base-system, commit this with revbump, please
Comment 9 Doug Goldstein (RETIRED) gentoo-dev 2013-01-23 06:43:55 UTC
(In reply to comment #8)
> (In reply to comment #2)
> > --- iscsid.orig	2012-06-18 13:19:55.243696604 +0200
> > +++ iscsid	2012-06-18 13:22:28.714753575 +0200
> > @@ -40,7 +40,7 @@
> >  	modopts="$@"
> >  	for m in ${modules}
> >  	do
> > -		if [ -n "$(modprobe -l | grep ${m})" ]
> > +		if modprobe --show --quiet "${m}"
> >  		then
> >  			ebegin "${msg} ${m}"
> >  			modprobe ${modopts} ${m}
> > 
> > fixes this issue.
> 
> Looks good. @base-system, commit this with revbump, please

Bigger refactor coming with the version bump.
Comment 10 Mark H. Wood 2013-01-25 19:39:10 UTC
Why not just remove the whole 'if' clause and 'else' clause?  That's how I fixed it here.

If module 'foo' doesn't exist, modprobe will say so and return error.  The If block is needless complexity.  Get rid of it and nobody has to worry that 'modprobe -nq' may also be removed someday.
Comment 11 jonathan.borgeaud 2013-02-13 07:51:35 UTC
Hi folks, Have the same bug here. Why the new init sceipt is not available when "etc-update" ?
Comment 12 Samuli Suominen (RETIRED) gentoo-dev 2013-03-07 10:25:06 UTC
(In reply to comment #9)
> (In reply to comment #8)
> > (In reply to comment #2)
> > > --- iscsid.orig	2012-06-18 13:19:55.243696604 +0200
> > > +++ iscsid	2012-06-18 13:22:28.714753575 +0200
> > > @@ -40,7 +40,7 @@
> > >  	modopts="$@"
> > >  	for m in ${modules}
> > >  	do
> > > -		if [ -n "$(modprobe -l | grep ${m})" ]
> > > +		if modprobe --show --quiet "${m}"
> > >  		then
> > >  			ebegin "${msg} ${m}"
> > >  			modprobe ${modopts} ${m}
> > > 
> > > fixes this issue.
> > 
> > Looks good. @base-system, commit this with revbump, please
> 
> Bigger refactor coming with the version bump.

I realize you wanted to bump this with a fix for this bug too, but fact is that kmod is now stable and module-init-tools lastrited so "time up" :)

I've committed the fix from Comment #8 (Well, Comment #1) as -r2
Comment 13 Samuli Suominen (RETIRED) gentoo-dev 2013-08-05 06:21:54 UTC
*** Bug 468290 has been marked as a duplicate of this bug. ***