[Twisted-Python] how to stop a service

Jean-Paul Calderone exarkun at divmod.com
Sat Jun 10 15:15:21 EDT 2006

On Sat, 10 Jun 2006 17:01:55 -0200, Manlio Perillo <manlio_perillo at libero.it> wrote:
>Jean-Paul Calderone ha scritto:
>> [...]
>>> Just another question: when running application with twistd, how can I
>>> return error codes from my application to operating system?
>>> That is: where (and how) can I safely call os.exit?
>> There's no support for this yet.
>What about storing the return code in the application instance and call
>os.exit(application.retcode) in an after shutdown system event?

That's probably not a bad idea.  One slight change I would suggest is
having the attribute be specified by the IProcess interface and stored
on that facet of the application componentized.  See tickets #718 and
#761 in the tracker.  If someone contributes patches implementing some
functionality in this area I'll try to get it committed.


More information about the Twisted-Python mailing list