[Twisted-Python] Twisted and NT Services

screwtape at froup.com screwtape at froup.com
Tue Jun 24 01:54:00 EDT 2003


On Tue, Jun 24, 2003 at 12:54:32PM +1000, Andrew Bennetts wrote:
> On Tue, Jun 24, 2003 at 11:31:53AM +1000, screwtape at froup.com wrote:
> [...]
> > Also, I've gotten into the habit of using py2exe to turn scripts into
> > standalone Win32 programs, and it would be really nice to be able to
> > ship a standalone NT service. Unfortunately, there seems to be a "pick
> > any two" relationship between Twisted, NT Services, and py2exe - when
> > I try and combine all three, I get the following traceback inside my
> > Application.run() call:
> > 
> >       File "twisted\internet\app.pyc", line 861, in run
> >     --- <exception caught here> ---
> >       File "twisted\python\log.pyc", line 64, in callWithLogger
> >       File "twisted\python\log.pyc", line 51, in callWithContext
> >       File "twisted\python\context.pyc", line 32, in callWithContext
> >       File "twisted\internet\default.pyc", line 122, in run
> >       File "twisted\internet\default.pyc", line 116, in startRunning
> >       File "twisted\internet\default.pyc", line 88, in _handleSignals
> >     exceptions.ValueError: signal only works in main thread
> 
> Try passing installSignalHandlers=0 to Application.run to work around this.
> 
> -Andrew.

For any lurking FAQ maintainers, that seemed to do the trick quite
nicely. I lose the ability to kill a service with ^C, but you can't
really send a ^C to a service anyway.

If I have time in the near future, I'll try and have a look at what
twistd does, what NT services need, and whether the two can be made to
meet.

-- 
 ___________ ____________________________
| Screwtape | Reply-To: munged on Usenet |________ ______ ____ __ _  _   _
|
| I don't lick skyscrapers.
|




More information about the Twisted-Python mailing list