[Twisted-Python] how to stop a service

Manlio Perillo manlio_perillo at libero.it
Sat Jun 10 16:17:35 EDT 2006


Jean-Paul Calderone ha scritto:
> 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.  

Yes, this is much better.

> 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.
> 

By the way, there is no support for installing user defined handlers for
signals?

In this way I can implement this idea in my application.



Thanks and regards   Manlio Perillo





More information about the Twisted-Python mailing list