Hi Emile,<br>The problem is that I am trying to solve is as follows. I use <a href="http://fabfile.org">Fabric</a> or <a href="http://ansible.cc">Ansible</a> for my deployment process. Part of the deployment process is to start/stop/restart certain services. What I found is that running /etc/init.d/rabbitmq-server start would start the service, but that the service would die right after the deployment task completed. <br>
<br>My understanding of debugging this problem is that the process is started under the context of the deployer's connection to the remote host (the SSH session) but as soon as that context dies the backgrounded process (rabbitmq-server) also died. I was able to test this theory by putting in a long wait at the end of the init.d/rabbitmq-server script and noticed that the service stayed up during the wait, but as soon as the Ansible/Fabric script exited the rabbitmq-server process also died. Note that this does NOT happen under normal login. As a stop-gap fix I used nohup to ensure that the process did not die, but upon discussion with others I was lead to think that the init.d script may be malfunctioning.<br>
<br>Looking into the problem further I found that the Debian init script used start-stop-daemon. The equivalent in RHEL seems to be the "daemon" function in /etc/rc.d/init.d/functions. It's possible that I misunderstood this to be present in all RHEL-type machines (it's present on my RHEL5.6+ and CentOS 5.6+ machines).<br>
<br>Please let me know if the proposed fix is incorrect/problematic. I found that applying this patch solved my problem, but perhaps there's a better way to ensure that the backgrounded process (i.e., $START_PROG $DAEMON &) does not die upon termination of the caller's shell context.<br>
<br>Thanks much.<br><br><div class="gmail_quote">On Thu, Sep 27, 2012 at 7:20 AM, Emile Joubert <span dir="ltr"><<a href="mailto:emile@rabbitmq.com" target="_blank">emile@rabbitmq.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On 27/09/12 12:10, Emile Joubert wrote:<br>
> "runuser". We are aware that this is not suitable for all RPM<br>
> distributions (notably SuSE) and we intend to correct that.<br>
<br>
</div>Let me correct that: START_PROG is currently set to runuser for Fedora<br>
and setsid for SuSE-based distributions. We intend to make the scripts<br>
more idiomatic for SuSE.<br>
<br>
It is not clear from your patch what problem you are trying to solve.<br>
Perhaps if you explain more what you intended to achieve we can help.<br>
<span class="HOEnZb"><font color="#888888"><br>
<br>
-Emile<br>
<br>
<br>
</font></span></blockquote></div><br>