problems with popen (linux7.3 python2.2.2)

Byrom, R (Rob) R.Byrom at rl.ac.uk
Wed Nov 26 08:48:27 EST 2003


I think I've found the problem.

When I run the python script I run it as a background process, this seems to
cause any popen() calls to hang indefinately (where each call remotely
executes a command via ssh). I'm not sure why this is the case though so I
was hoping someone could help explain!

thanks,
rob

-----Original Message-----
From: Byrom, R (Rob) [mailto:R.Byrom at rl.ac.uk]
Sent: Wednesday, November 26, 2003 1:15 PM
To: 'python-list at python.org'
Subject: problems with popen (linux7.3 python2.2.2)


hi, 
When I use: 
os.popen('ssh -l root at something tomcat4 stop') 
I find the command always hangs. The 'something' host contains the correct
key in the authorized_hosts file and works ok on the command prompt. I've
tried os.system() but this also hangs. I notice that the 'tomcat4 stop' is
being executed but when I do a 'ps -ef' I notice the popen process is still
alive. I've also noticed this command sometimes works (ie it doesnt hang)
but I've no idea why. Has anyone experienced similar problems with this? Or
does anyone have any alternative suggestions? I'm really at my wits end with
this one! 
thanks alot, 
Rob 


-- 
http://mail.python.org/mailman/listinfo/python-list





More information about the Python-list mailing list