Well, I have the same problem when subprocessing "/etc/init.d/rabbitmq-server start".<div><br></div><div>Note that I have no problem subprocessing "service rabbitmq-server status" or "service rabbitmq-server stop" (or any other service). </div>
<div><br></div><div>My only issue is with the start method of /etc/init.d/rabbitmq-server init script.<br><div><br></div><div><br><br><div class="gmail_quote">On Tue, Oct 16, 2012 at 1:34 PM, Tim Watson <span dir="ltr"><<a href="mailto:tim@rabbitmq.com" target="_blank">tim@rabbitmq.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">When you run RabbitMQ on an rpm based distro using /sbin/service then the init script is going to redirect stdio, as you would expect for a service/daemon. You'll need to start RabbitMQ directly from the ./scripts/rabbitmq-server shell script I guess, if you want to grab stdio - or tail the logs?<br>
<div><div class="h5"><br>
On 16 Oct 2012, at 11:47, Raphaël De GIUSTI wrote:<br>
<br>
> Hi everyone,<br>
><br>
> Starting the rabbitmq-server service with python's Popen from subprocess makes it hang.<br>
><br>
> Here's the little snippet to reproduce it (tested on Fedora 16 + Python2.7 and Centos 6.3 + Python2.6)<br>
><br>
> from subprocess import PIPE, Popen<br>
> proc = Popen('service rabbitmq-server start', shell=True, stderr=PIPE, stdout=PIPE)<br>
> print proc.communicate()<br>
><br>
> Problem is with "stdout=PIPE", I think.<br>
><br>
> The following snippet works, using proc.wait()<br>
><br>
> from subprocess import PIPE, Popen<br>
> proc = Popen('service rabbitmq-server start', shell=True, stderr=PIPE, stdout=PIPE)<br>
> print proc.wait()<br>
><br>
> Any idea on how to fix it using proc.communicate() because I need feedback from the "subprocess.PIPE" ?<br>
><br>
> Thank you.<br>
><br>
> Raphael<br>
</div></div>> _______________________________________________<br>
> rabbitmq-discuss mailing list<br>
> <a href="mailto:rabbitmq-discuss@lists.rabbitmq.com">rabbitmq-discuss@lists.rabbitmq.com</a><br>
> <a href="https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss" target="_blank">https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss</a><br>
<br>
_______________________________________________<br>
rabbitmq-discuss mailing list<br>
<a href="mailto:rabbitmq-discuss@lists.rabbitmq.com">rabbitmq-discuss@lists.rabbitmq.com</a><br>
<a href="https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss" target="_blank">https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss</a><br>
</blockquote></div><br></div></div>