[rabbitmq-discuss] "service rabbitmq-server start" hangs when using python's Popen from subprocess.
Raphaël De GIUSTI
raphael.degiusti at guardis.com
Tue Oct 16 11:47:31 BST 2012
Hi everyone,
Starting the rabbitmq-server service with python's Popen from subprocess
makes it hang.
Here's the little snippet to reproduce it (tested on Fedora 16 + Python2.7
and Centos 6.3 + Python2.6)
from subprocess import PIPE, Popen
> proc = Popen('service rabbitmq-server start', shell=True, stderr=PIPE,
> stdout=PIPE)
> print proc.communicate()
Problem is with "stdout=PIPE", I think.
The following snippet works, using proc.wait()
from subprocess import PIPE, Popen
> proc = Popen('service rabbitmq-server start', shell=True, stderr=PIPE,
> stdout=PIPE)
> print proc.wait()
Any idea on how to fix it using proc.communicate() because I need feedback
from the "subprocess.PIPE" ?
Thank you.
Raphael
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20121016/3e3d2df0/attachment.htm>
More information about the rabbitmq-discuss
mailing list