Re: Getting pid of a remote process

2008-08-19 Thread Kurt Mueller
srinivasan srinivas schrieb: Thanks a lot. But i am wondeing will it return correct pid if more than one instance of run on the remote machine?? Thanks, Srini On UNIX-like OS: If you start the process in the background, you can get the PID with: :~> ssh 'ls -l & echo PID=$!' | grep PID PI

Re: Getting pid of a remote process

2008-08-19 Thread Miles
On Mon, Aug 18, 2008 at 9:34 AM, srinivasan srinivas wrote: > Could you please suggest me a way to find pid of a process started on a > remote machine by the current process?? If ps + grep (or the more robust tool pgrep) won't work because you're running more than one instance at once, try this:

Re: Getting pid of a remote process

2008-08-19 Thread Diez B. Roggisch
srinivasan srinivas wrote: > Thanks a lot. > But i am wondeing will it return correct pid if more than one instance of > run on the remote machine?? Thanks, What do you *think*? How about *trying* that out first? Diez -- http://mail.python.org/mailman/listinfo/python-list

Re: Getting pid of a remote process

2008-08-19 Thread srinivasan srinivas
etting pid of a remote process srinivasan srinivas wrote: > This is wat i am doing : > > args = [ "SSH", ,  ] > I am giving this to subprocess.Popen() > Thanks, > Srini Then the answer is simple: how would you figure out the remote process pid using ssh? Once you found

Re: Getting pid of a remote process

2008-08-19 Thread Diez B. Roggisch
srinivasan srinivas wrote: > This is wat i am doing : > > args = [ "SSH", ,  ] > I am giving this to subprocess.Popen() > Thanks, > Srini Then the answer is simple: how would you figure out the remote process pid using ssh? Once you found that out, pass that to Popen. Make sure you capture stdou

Re: Getting pid of a remote process

2008-08-19 Thread srinivasan srinivas
This is wat i am doing : args = [ "SSH", ,  ] I am giving this to subprocess.Popen() Thanks, Srini - Original Message From: Diez B. Roggisch <[EMAIL PROTECTED]> To: python-list@python.org Sent: Tuesday, 19 August, 2008 12:26:20 PM Subject: Re: Getting pid of

Re: Getting pid of a remote process

2008-08-19 Thread Willi Richert
> From: Diez B. Roggisch <[EMAIL PROTECTED]> > To: python-list@python.org > Sent: Monday, 18 August, 2008 9:23:20 PM > Subject: Re: Getting pid of a remote process > > srinivasan srinivas schrieb: > > Hi, > > Could you please suggest me a way to find pid of a

Re: Getting pid of a remote process

2008-08-19 Thread Diez B. Roggisch
srinivasan srinivas schrieb: HI, I am using Solaris and subprocess.Popen to spawn a process on a remote machine. No, you are *not* doing that. You are maybe using subproces to run SSH to spawn a remote process. Why don't you *show* us how you actually do that? DIEZ -- http://mail.python.org/

Re: Getting pid of a remote process

2008-08-18 Thread srinivasan srinivas
HI, I am using Solaris and subprocess.Popen to spawn a process on a remote machine. Thanks, Srini - Original Message From: Diez B. Roggisch <[EMAIL PROTECTED]> To: python-list@python.org Sent: Monday, 18 August, 2008 9:23:20 PM Subject: Re: Getting pid of a remote process srin

Re: Getting pid of a remote process

2008-08-18 Thread Diez B. Roggisch
srinivasan srinivas schrieb: Hi, Could you please suggest me a way to find pid of a process started on a remote machine by the current process?? I should get pid in the current process environment. The approach should be somewhat generic. It shouldn't expect the remote process to print its pid

Getting pid of a remote process

2008-08-18 Thread srinivasan srinivas
Hi, Could you please suggest me a way to find pid of a process started on a remote machine by the current process?? I should get pid in the current process environment. The approach should be somewhat generic. It shouldn't expect the remote process to print its pid. Thanks, Srini Unlimit