Hi,<br><div><br></div><div>I&#39;m attempting to create an ubuntu service that when started will run in the background processing beanstalk jobs.</div><div>I&#39;ve taken the code from beanstalk-client twisted to act as my beanstalk client (<a href="https://github.com/dustin/beanstalk-client-twisted/blob/master/beanstalk.py" target="_blank">https://github.com/dustin/beanstalk-client-twisted/blob/master/beanstalk.py</a>)</div>

<div><br></div><div>The issue I&#39;m having is how do I set up my service (ocapi.py) so that when the daemon (ocapi) starts it detaches from the process, which isn&#39;t&#39; happening right now.</div><div><br></div><div>
ocapi.py (service) &lt;--this is what should detach and I put it in /usr/sbin/ocapi.py code found at <a href="http://pastebin.com/29VnXnrm" target="_blank" style="font-size:13px;color:rgb(17,85,204);font-family:arial,sans-serif;background-color:rgb(255,255,255)">http://pastebin.com/29VnXnrm</a></div>

<div>ocapi (daemon) &lt;-- goes int /etc/init.d/ocapi code found at <a href="http://pastebin.com/0QgRfTfu" target="_blank" style="font-size:13px;color:rgb(17,85,204);font-family:arial,sans-serif;background-color:rgb(255,255,255)">http://pastebin.com/0QgRfTfu</a></div>
<div><br></div><div><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">stephan@oc:~$ sudo /etc/init.d/ocapi start</span><br style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"> * Starting ocapi... Removing stale pidfile /var/run/ocapi.pid</span><br style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">Connected!</span></div><div><br></div><div>...problem is I don&#39;t get my shell prompt back when i start the service, meaning it didn&#39;t detach from the parent process...hopefully someone can shed some light on this.</div>
<div>Thanks,</div><div>Stephan</div><div><br></div><div><br></div>