Bug 470229 - iscsi._stopIscsiDaemon() is buggy
iscsi._stopIscsiDaemon() is buggy
Status: CLOSED NEXTRELEASE
Product: Fedora
Classification: Fedora
Component: anaconda (Show other bugs)
rawhide
All Linux
medium Severity medium
: ---
: ---
Assigned To: Hans de Goede
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2008-11-06 07:06 EST by Hans de Goede
Modified: 2008-11-08 07:35 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-11-08 07:35:32 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Hans de Goede 2008-11-06 07:06:03 EST
looking at _stopIscsiDaemon() which gets called from iscsi.shutdown():

        result = iutil.execWithCapture(ISCSIADM, ["-k", "0"])
        result.strip()
        if result == "":
            return

        psout = iutil.execWithCapture("/usr/bin/pidof", ["iscsid"])
        if psout.strip() != "":
            log.info("iSCSI shutdown")
            for t in self.targets:
                t.logout()

            for pidstr in psout.split():
                pid = string.atoi(pidstr)
                log.info("killing %s %d" % (ISCSID, pid))

                os.kill(pid, signal.SIGKILL)

            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.
Comment 1 Hans de Goede 2008-11-06 08:09:00 EST
Re-assigning to me.
Comment 2 Hans de Goede 2008-11-08 07:35:32 EST
This is fixed in git now, the next anaconda release 11.4.1.57 will include this fix: http://git.fedorahosted.org/git/?p=anaconda.git;a=commitdiff;h=16e749370862837666ac40252c6f2cdb41037072

Note You need to log in before you can comment on or make changes to this bug.