python and ssh

Jim jim_8421 at hotmail.com
Wed Jul 21 20:22:16 EDT 2004


Hi,

I'm fairly new to python, and unix systems in general.

I have a script where I am trying to launch a remote process.  What
I'm doing is something like:

from host machine:
p = popen2.POpen4('ssh user at remote ssh /home/remote.py cmd arg1 arg2
...' )

so the remote machine has a remote.py script which gets the arguments
that i want to execute.

in the remote.py script, i pretty much just do a 
pid = os.spawnv( os.P_NOWAIT, [cmd, cmdname, arg1, arg2, ... ] )
then i exit the script, i also send the pid over a socket before
exiting.

I noticed that even thought the python process dies, ssh still 'knows'
about the spawned process, so the ssh session is still going.

My question is can I rely on this behavior?  How did ssh know about
the spawned process?

Thank you,



More information about the Python-list mailing list