hey Jean-Paul,<div><br></div><div>I&#39;m using twistd - if you see the daemon code it&#39;s in there to start and manage the service.<br><br>For some reason the OC Daemon pastebin linkted didn&#39;t work but this one does:<br>
<br>OC Daemon that starts the OC Service<br><a href="http://pastebin.com/g0UE7An8">http://pastebin.com/g0UE7An8</a><br><br>still know don&#39;t know what to change to get the service to run and detach from the parent process. Any help is appreciated.<br>
<br>Stephan<br><br><br><br><br><div class="gmail_quote">On Sat, Oct 6, 2012 at 6:56 PM,  <span dir="ltr">&lt;<a href="mailto:exarkun@twistedmatrix.com" target="_blank">exarkun@twistedmatrix.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>On 6 Oct, 10:30 pm, <a href="mailto:schenette@gmail.com" target="_blank">schenette@gmail.com</a> wrote:<br>
&gt;Hi,<br>
&gt;<br>
&gt;I&#39;m attempting to create an ubuntu service that when started will run<br>
&gt;in<br>
&gt;the background processing beanstalk jobs.<br>
&gt;I&#39;ve taken the code from beanstalk-client twisted to act as my<br>
&gt;beanstalk<br>
&gt;client (<br>
&gt;<a href="https://github.com/dustin/beanstalk-client-" target="_blank">https://github.com/dustin/beanstalk-client-</a><br>
&gt;twisted/blob/master/beanstalk.py)<br>
&gt;<br>
&gt;The issue I&#39;m having is how do I set up my service (ocapi.py) so that<br>
&gt;when<br>
&gt;the daemon (ocapi) starts it detaches from the process, which isn&#39;t&#39;<br>
&gt;happening right now.<br>
<br>
</div>Use twistd, which comes with daemonization features.  From the looks of<br>
your code, you&#39;re halfway there already.<br>
<br>
  <a href="http://twistedmatrix.com/documents/current/core/howto/basics.html#auto1" target="_blank">http://twistedmatrix.com/documents/current/core/howto/basics.html#auto1</a><br>
  <a href="http://twistedmatrix.com/documents/current/core/howto/application.html" target="_blank">http://twistedmatrix.com/documents/current/core/howto/application.html</a><br>
<br>
Jean-Paul<br>
<div>&gt;ocapi.py (service) &lt;--this is what should detach and I put it in<br>
&gt;/usr/sbin/ocapi.py code found at <a href="http://pastebin.com/29VnXnrm" target="_blank">http://pastebin.com/29VnXnrm</a><br>
&gt;ocapi (daemon) &lt;-- goes int /etc/init.d/ocapi code found at<br>
&gt;<a href="http://pastebin.com/0QgRfTfu" target="_blank">http://pastebin.com/0QgRfTfu</a><br>
&gt;<br>
&gt;stephan@oc:~$ sudo /etc/init.d/ocapi start<br>
&gt;* Starting ocapi... Removing stale pidfile /var/run/ocapi.pid<br>
&gt;Connected!<br>
&gt;<br>
&gt;...problem is I don&#39;t get my shell prompt back when i start the<br>
&gt;service,<br>
&gt;meaning it didn&#39;t detach from the parent process...hopefully someone<br>
&gt;can<br>
&gt;shed some light on this.<br>
&gt;Thanks,<br>
&gt;Stephan<br>
<br>
</div>_______________________________________________<br>
Twisted-Python mailing list<br>
<a href="mailto:Twisted-Python@twistedmatrix.com" target="_blank">Twisted-Python@twistedmatrix.com</a><br>
<a href="http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python" target="_blank">http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python</a><br>
</blockquote></div><br></div>