[python-win32] Re: py2exe and services

Thomas Heller theller at python.net
Thu Apr 17 14:28:13 EDT 2003


"Larry Bates" <lbates at syscononline.com> writes:

> Does anyone know of a way to install py2exe services and have 
> them start automatically (e.g. like the --start auto install 
> option you can use on regular Python services).  I want my 
> services to restart if the server gets rebooted and would prefer 
> not to be forced to manually modify the service through services 
> manager control panel applet).  Seems that py2exe doesn't have 
> many of the options found on command line for regular Python 
> services.  I also seem to be forced into using NET START/STOP to 
> start py2exe services because the .EXE can't seem to start
> itself.  If I execute it stand alone I get:
> 
> syncusersservice.exe
> syncusersservice.exe - Python Service Manager
> Options:
>  -install - Install this service.
>  -remove - Remove this service.
>  -debug [parms] - debug the service.
> 
> Starting service - this may take several seconds - please wait...
> Could not start the service - error 997
> 
> I'm hoping someone out there has already encountered/solved this
> problem.

I did only provide the absolute minimum needed (install and remove a
service), because this is all implemented in C (and actually copied from
the win32all sources).

The rest can be configured from the control panel services applet.

Better than to reimplement in C the functionality which is already in
win32serviceutil.py would be to change the C code to call win32serviceutil.

But I have no time currently for py2exe, unfortunately.

Another great idea would be to rewrite PythonService.cpp with ctypes.
This would even make the special casing for services in py2exe
unneeded.

Thomas




More information about the Python-win32 mailing list