Many thanks !
This is what I did
for mytunnel.py :
I use pexpect like this
tunnel_command = '''bash -c "ssh -N -R 60011:localhost:60002
[EMAIL PROTECTED] "'''
com="echo \""+str(ssh_tunnel.pid)+"\" >> pids"
...
time.sleep(172800)
in the bash script which calls mytunnel.py :
./mytunnel.py $
On May 5, 7:18 am, Karim Bernardet <[EMAIL PROTECTED]> wrote:
> ssh_tunnel = pexpect.spawn (tunnel_command % globals())
> ...
> print ssh_tunnel.pid
>
> but ssh_tunnel is not the pid of the ssh tunnel
>
> Is there a way to get it using pexpect ?
You will notice that you can't get this information
Karim Bernardet <[EMAIL PROTECTED]> wrote:
> Hi
>
> I am using pexpect to do ssh tunneling and to open a vnc server (jobs on
> a grid cluster). When the job is canceled, these 2 processes remain on
> the worker node (they are detached), so I have to kill them (using a
> trap command in the