469,290 Members | 1,913 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,290 developers. It's quick & easy.

remote process managing

Hi,

I am working on a project where I need to start processes on remote
machines, across mac, linux, windows from one server or 'manager'
machine.

For now, I only need to implement a 'wait' type command , so I can
wait for the remote machine to finish, everything is synchronized in
this respect.

I'm not sure the best way to do this. Currently, I will do a
popen2.Popen4 command to start the ssh command, example:

ssh user@hostname command arg1 arg2 ...

Then I do a Popen4.poll() and wait for it to finish.

The problem is if the process hangs, I can't end it. So I created a
python script on the remote machine (which i call in the ssh command)
which does a os.spawnv on the command, then i create a socket to send
its process id over. Once I receive it I can poll and if it takes too
long kill the remote pid, and my ssh session.

But, is there an easier way to do this? ssh is capturing the stdout,
stderr streams from the other process. Maybe I can create some type
of shared file instead? Any suggestions?

Thanks,
student
Jul 18 '05 #1
0 1320

This discussion thread is closed

Replies have been disabled for this discussion.

By using this site, you agree to our Privacy Policy and Terms of Use.