Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
problems with popen (linux7.3 python2.2.2)
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  4 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Byrom, R (Rob)  
View profile  
 More options Nov 26 2003, 9:01 am
Newsgroups: comp.lang.python
From: "Byrom, R (Rob) " <R.By...@rl.ac.uk>
Date: Wed, 26 Nov 2003 13:15:29 -0000
Local: Wed, Nov 26 2003 8:15 am
Subject: problems with popen (linux7.3 python2.2.2)
hi,
When I use:
os.popen('ssh -l root@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

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Byrom, R (Rob)  
View profile  
 More options Nov 26 2003, 9:01 am
Newsgroups: comp.lang.python
From: "Byrom, R (Rob) " <R.By...@rl.ac.uk>
Date: Wed, 26 Nov 2003 13:48:27 -0000
Local: Wed, Nov 26 2003 8:48 am
Subject: RE: problems with popen (linux7.3 python2.2.2)
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


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Michael T. Babcock  
View profile  
 More options Nov 26 2003, 11:01 am
Newsgroups: comp.lang.python
From: "Michael T. Babcock" <mbabc...@fibrespeed.net>
Date: Wed, 26 Nov 2003 10:49:55 -0500
Local: Wed, Nov 26 2003 10:49 am
Subject: Re: problems with popen (linux7.3 python2.2.2)

>When I use:
>os.popen('ssh -l root@something tomcat4 stop')
>I find the command always hangs.

Try adding a "-t" to your SSH command-line; it forces it to request a
TTY instead of being silent.  SSH tries to do "the right thing" when not
launched from a terminal prompt.

--
Michael T. Babcock
C.T.O., FibreSpeed Ltd.
http://www.fibrespeed.net/~mbabcock


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Byrom, R (Rob)  
View profile  
 More options Nov 26 2003, 12:01 pm
Newsgroups: comp.lang.python
From: "Byrom, R (Rob) " <R.By...@rl.ac.uk>
Date: Wed, 26 Nov 2003 16:34:51 -0000
Local: Wed, Nov 26 2003 11:34 am
Subject: RE: problems with popen (linux7.3 python2.2.2)
thanks! I'll give this a try. I did managed to avoid the 'hang' by putting
the python script in the foreground (previously I was running the script as
a back ground process).

-----Original Message-----
From: Michael T. Babcock [mailto:mbabc...@fibrespeed.net]
Sent: Wednesday, November 26, 2003 3:50 PM
To: python-l...@python.org
Subject: Re: problems with popen (linux7.3 python2.2.2)

>When I use:
>os.popen('ssh -l root@something tomcat4 stop')
>I find the command always hangs.

Try adding a "-t" to your SSH command-line; it forces it to request a
TTY instead of being silent.  SSH tries to do "the right thing" when not
launched from a terminal prompt.

--
Michael T. Babcock
C.T.O., FibreSpeed Ltd.
http://www.fibrespeed.net/~mbabcock

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


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »