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

Bug 307619

Summary: sys-block/open-iscsi - broken initscript
Product: Gentoo Linux Reporter: Doktor Notor <notordoktor>
Component: New packagesAssignee: Gentoo's Team for Core System packages <base-system>
Status: RESOLVED FIXED    
Severity: major CC: base-system, craig, gentoo, premek, spamtrap+gentoo, staff
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on: 340425    
Bug Blocks:    
Attachments: initscript patch
iscsid-init.d
iscsid-conf.d
iscsid-conf.d.patch
iscsid-init.d.patch
iscsid-init.d

Description Doktor Notor 2010-03-03 14:08:41 UTC
The initscript doesn't work at all - it fails to stop the thing everytime and subsequently fails to start as well, simply because:

- it sends SIGHUP to the process, which makes it reload the configuration instead of SIGTERM which would terminate it
- it tries to use $PID_FILE variable which is not definied anywhere, so it doesn't remove the pidfile either, plus the "ugly" portion of the script is not necessary at all, since the daemon removes its pidfile just fine once you tell it to terminate instead of reload config.

As a result, on repeated /etc/init.d/iscsid start the script seems to "fail" but repeated running instances of /usr/sbin/iscsid keep piling up instead.

Patch for 2.0.871-r1 attached.
Comment 1 Doktor Notor 2010-03-03 14:09:08 UTC
Created attachment 221933 [details, diff]
initscript patch
Comment 2 Stefan Behte (RETIRED) gentoo-dev Security 2010-03-07 19:40:44 UTC
An additional problem is, if you use AUTOSTARTTARGETS="yes" it will "return $?", then the runscript system thinks that iscsid wasn't started, but the deamon is indeed still running.

At that point, we could:
- run stop(), disconnect from already connected targets, unload iscsi modules
- ignore the error

Maybe we could add AUTOSTART="strict" which will run stop(); otherwise the error should be ignored. 

Opinions?
Comment 3 Stefan Behte (RETIRED) gentoo-dev Security 2010-03-07 19:47:53 UTC
Created attachment 222547 [details]
iscsid-init.d
Comment 4 Stefan Behte (RETIRED) gentoo-dev Security 2010-03-07 19:48:08 UTC
Created attachment 222549 [details]
iscsid-conf.d
Comment 5 Stefan Behte (RETIRED) gentoo-dev Security 2010-03-07 19:49:23 UTC
Created attachment 222551 [details, diff]
iscsid-conf.d.patch
Comment 6 Stefan Behte (RETIRED) gentoo-dev Security 2010-03-07 19:49:59 UTC
Created attachment 222553 [details, diff]
iscsid-init.d.patch
Comment 7 Doktor Notor 2010-03-07 21:14:56 UTC
(In reply to comment #2)
> Maybe we could add AUTOSTART="strict" which will run stop(); otherwise the
> error should be ignored. 

+1 on this... no need to stop() otherwise. And yeah, good point, the problem you've described is annoying as well.
Comment 8 Stefan Behte (RETIRED) gentoo-dev Security 2010-10-08 20:45:03 UTC
Created attachment 249972 [details]
iscsid-init.d
Comment 9 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2012-02-09 09:20:39 UTC
InCVS.