Re: [PATCH 04/05] add common iscsi.py module

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Feb 06, 2006 at 04:39:00PM -0500, Jeremy Katz wrote:

Okay with all your comments (thanks) except:

> On Fri, 2006-02-03 at 14:04 -0800, Patrick Mansfield wrote:

> > +    def shutdown(self):
> [snip]
> > +        # Note that iscsid has/had code to ignore 2 (SIGINT), hence the
> > +        # 9 (SIGKILL).
> 
> If we run iscsid with -p and save the pid in /tmp, then we can have a
> much more robust kill.  

There are really two iscsid processes, I think one is the logger and the
other the true daemon, but only one pid in the pid file, so I can't use
that to kill both.

There was a shutdown patch submitted (add iscsid '-k' option), that would
work really nice here but it is not in iscsi svn (nor I assume FC devel).

Are you OK with changing the ps and kill to use execWithCapture()?

i.e. this part:

        command = ("ps -C %s" % (ISCSID_NAME))
        log.debug("Running popen %s" % (command, ))
        psout = os.popen(command)
        # Skip header line
        psout.readline()
        for line in psout.readlines():
            pid = string.atoi(string.split(line)[0])
            log.info("Killing %s %d" % (ISCSID_NAME, pid))
            os.kill(pid, signal.SIGKILL)

Should be something like:

        psout = iutils.execWithCapture("ps", "--no-headers -C %s" %
                                              (ISCSID_NAME))
        for line in psout:
            pid = string.atoi(string.split(line)[0])
            log.info("Killing %s %d" % (ISCSID_NAME, pid))
            os.kill(pid, signal.SIGKILL)

-- Patrick Mansfield


[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux