[Twisted-Python] how to daemonize twisted...and detatch from shell process
schenette at gmail.com
Sun Oct 7 20:13:24 EDT 2012
I'm using twistd - if you see the daemon code it's in there to start and
manage the service.
For some reason the OC Daemon pastebin linkted didn't work but this one
OC Daemon that starts the OC Service
still know don't know what to change to get the service to run and detach
from the parent process. Any help is appreciated.
On Sat, Oct 6, 2012 at 6:56 PM, <exarkun at twistedmatrix.com> wrote:
> On 6 Oct, 10:30 pm, schenette at gmail.com wrote:
> >I'm attempting to create an ubuntu service that when started will run
> >the background processing beanstalk jobs.
> >I've taken the code from beanstalk-client twisted to act as my
> >client (
> >The issue I'm having is how do I set up my service (ocapi.py) so that
> >the daemon (ocapi) starts it detaches from the process, which isn't'
> >happening right now.
> Use twistd, which comes with daemonization features. From the looks of
> your code, you're halfway there already.
> >ocapi.py (service) <--this is what should detach and I put it in
> >/usr/sbin/ocapi.py code found at http://pastebin.com/29VnXnrm
> >ocapi (daemon) <-- goes int /etc/init.d/ocapi code found at
> >stephan at oc:~$ sudo /etc/init.d/ocapi start
> >* Starting ocapi... Removing stale pidfile /var/run/ocapi.pid
> >...problem is I don't get my shell prompt back when i start the
> >meaning it didn't detach from the parent process...hopefully someone
> >shed some light on this.
> Twisted-Python mailing list
> Twisted-Python at twistedmatrix.com
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Twisted-Python