-------- Original Message -------- Subject: Re: checking that process binds a port, fuser functionality From: Roy Smith <r...@panix.com> To: python-list@python.org Date: Tue Aug 03 2010 13:06:27 GMT+0200 (CEST)
> In article <pan.2010.08.03.08.47.38.391...@nowhere.com>, > Nobody <nob...@nowhere.com> wrote: > >> On Mon, 02 Aug 2010 23:27:37 +0200, Zdenek Maxa wrote: >> >>> I need to start a process (using subprocess.Popen()) and wait until the >>> new process either fails or successfully binds a specified port. >> If you just need to wait until *something* is listening on that port, you >> could try connect()ing to it. > > This certainly seems like the logical way to me. It's straight-forward, > simple, and portable. Yes, but I need a check that certain known process's PID listens on a defined port. connect() would certainly work, but I may end up connecting to a different process. I forgot to mention that my master daemon starts processes in question as external applications, defines port they should bind but starts them via different user via sudo, which makes checking /proc/net/tcp not possible. Well, seems it's turning out not straight-forward, but thanks a lot for your thoughts anyway! Zdenek -- http://mail.python.org/mailman/listinfo/python-list