[Twisted-Python] Could not create and run a Windows Service with Twisted 2.0.1 & Python 2.4.1

Luc Stepniewski luc.stepniewski at adelux.fr
Fri Jul 8 08:19:13 EDT 2005

I've written a Twisted Windows Service which works perfectly with Twisted 1.3 
and Python 2.3. I've used the sandboxed ntsvc from moonfallen's svn.

I upgraded everything to Twisted 2.0.1 and Python 2.4.1 (even tried 
ActiveState's), and followed the information provided in moonfallen's 
README-service (that is, patch pywin32's boot_service.py).

It compiles correctly to a .exe, without any supplementary error and I can 
install it correctly as a service (using 'xxxxxx.exe -install'). But When I 
try to launch it (in the GUI Service), it dies immediately, putting the 
following message in the Windows Event Observer:

The instance's SvcRun() method failed
  File "win32serviceutil.pyc", line 742, in SvcRun
  File "ntsvc\runner.pyc", line 79, in SvcDoRun
  File "ntsvc\runner.pyc", line 48, in run
  File "twisted\application\app.pyc", line 31, in installReactor
  File "twisted\python\reflect.pyc", line 344, in namedModule
exceptions.ImportError: No module named default

I even cleaned my code to have just a .tac with 2 lines, and it does the same 
error. So I'm pretty sure it's not a problem in my code.

Has anyone managed to create and run a service with Python 2.4.1 & Twisted 
2.0.1? I'm using py2exe 0.5.4 and pywin32 204 both for python 2.4.

Luc Stepniewski <luc.stepniewski at adelux.fr>
Adelux - Securite, Linux  Public key: <http://lstep.free.fr/pubkey.txt>
Key BC0E3C2A fingerprint = A4FA466C68D27E46B427  07D083ED6340BC0E3C2A
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://twistedmatrix.com/pipermail/twisted-python/attachments/20050708/369ff96b/attachment.pgp 

More information about the Twisted-Python mailing list