[Twisted-Python] how to daemonize twisted...and detatch from shell process
glyph at twistedmatrix.com
Mon Oct 15 12:01:46 EDT 2012
On Oct 7, 2012, at 5:13 PM, Stephan <schenette at gmail.com> wrote:
> hey Jean-Paul,
> 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 does:
> 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.
The fact that "ocapi.py" is in "/usr/sbin" suggests that it's designed to be run as a script and not as a twistd plugin. The shell script that you're citing is mostly irrelevant - that's just a wrapper to get twistd to run on your platform.
And, indeed, when I look at ocapi.py, I can see it has a 'reactor.run()' at the bottom of it, which means it's trying to run itself, not be run by twistd. That's not how a file passed to '--python' is supposed to work.
Are you the maintainer of ocapi.py? If not, you'll have to get them to make some changes.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Twisted-Python