remote process managing

S

student

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,534
Members
45,007
Latest member
obedient dusk

Latest Threads

Top