Problem freezing Win32 services

Thomas Heller thomas.heller at ion-tof.com
Thu Feb 14 08:27:29 EST 2002


> > > I'm attempting to freeze a Windows NT service (in Win2000) written in
> Python
> > > 2.2 using win32all 142 and the freeze util bundled with Python in the
> tools
> > > directory, and I've encountered some problems. Freezing console apps
> works
> > > fine.
> > <shameless plug>
> > You could (should ;-) try out the newest py2exe release, which also can
> > create service exe-files: http://starship.python.net/crew/theller/py2exe/
>
> I tried py2exe and it seems to work better at least :-) I mananged to create
> a service executable that can be started either from the Windows Services
> GUI or by 'net start myservice'.

Great! The first step is done.

>  However if I try to just run the service
> executable I get:
>
> Starting service - this may take several seconds - please wait...
> Could not start the service - error 997

This is more or less by design. Don't do this - use one of the command
line options when you start it from the command line.

>
> The real problem, however, starts when I move the executable and associated
> pyds and dlls to another computer. I then get the following error in the
> event viewer:
>
> "The description for Event ID ( 3 ) in Source ( myservice ) cannot be found.
> The local computer may not have the necessary registry information or
> message DLL files to display messages from a remote computer. The following
> information is part of the event:  ; e; N."
>
> I suspect I may be missing some imports. py2exe gave me some warnings,
> however I've tried to find out which it is with no luck. Is there any way to
> get more descriptive errors (tracebacks?)? Running the service with
> the -debug option outputs "Error 0xC0000003 - The instance's SvcRun() method
> failed" and  " e: N" . Any suggestions?
>
There is still a bug that tracebacks are not printed to the event
log correctly, will be fixed in the next release.

I think we should try to sort this out privately, please send me your
email address. Which Python version do you use? I could send you
some patches...

Thomas





More information about the Python-list mailing list