471,853 Members | 1,704 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,853 software developers and data experts.

remote process managing


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

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?

Jul 18 '05 #1
0 1392

This discussion thread is closed

Replies have been disabled for this discussion.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.