Red Hat Bugzilla – Bug 470229
iscsi._stopIscsiDaemon() is buggy
Last modified: 2008-11-08 07:35:32 EST
looking at _stopIscsiDaemon() which gets called from iscsi.shutdown():
result = iutil.execWithCapture(ISCSIADM, ["-k", "0"])
if result == "":
psout = iutil.execWithCapture("/usr/bin/pidof", ["iscsid"])
if psout.strip() != "":
for t in self.targets:
for pidstr in psout.split():
pid = string.atoi(pidstr)
log.info("killing %s %d" % (ISCSID, pid))
self.iscsidStarted = False
The first line executes "iscsiadm -k 0", which will kill iscsid and will not output anything, so 'result == ""' will be true and the method ends then and there. Also note how this code path fails to set iscsidStarted = False, but we
are getting lucky here, as the only path where this function gets called, we always call iscsi.startup after the shutdown, thus restarting iscsid.
The rest of the code thus never gets reached, resulting in no logouts being done. This actually is a good thing, there is no reason to logout / login on iscsi shutdown / startup. However stopping iscsid when we are logged in to iscsi nodes is a bad idea, so shutdown should not call _stopIscsiDaemon(), see bug 470223.
Re-assigning to me.
This is fixed in git now, the next anaconda release 220.127.116.11 will include this fix: http://git.fedorahosted.org/git/?p=anaconda.git;a=commitdiff;h=16e749370862837666ac40252c6f2cdb41037072