Robin Becker wrote:
> I'm trying out the denyhosts port; it starts up and performs as expected,
> but it won't recognize a running instance as this python if test fails.
> Is there a more freebsd way for python to find out if a given process is
> running?
> 
>     if os.access(os.path.join("/proc", str(pid)), os.F_OK):
>         return pid
>     else:
>         return STATE_LOCK_EXISTS
> 

If you know the pid, see whether you can deliver a continue signal to it:

    try:
        os.kill(pid, signal.SIGCONT)
        return pid
    except OSError:
        return STATE_LOCK_EXISTS

-- 
-Chuck

PS: "STALE_LOCK_EXISTS", maybe...?  :-)
_______________________________________________
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to