making a Windows NT service out of a python program

Bill Tutt billtut at microsoft.com
Tue Jul 13 11:23:19 EDT 1999


> From: Christian Tismer [mailto:tismer at appliedbiometrics.com]
> 
> Bill Tutt wrote:
> > 
> > Take a look at the stuff in win32\demos\service\ of your 
> friendly latest
> > Win32 extension install tree.
> > 
> > It shows you how to wrap Python code into an NT service 
> quite easily.
> > 
> > The code in win32\lib\win32serivceutil.py appears to do 
> almost everything
> > you would ever want to do with a service. Very cool stuff...
> 
> This is all great stuff if you have understood it already.
> For me, it is still unclear what makes up a service, and
> what I need at the minimum to turn a Python program into
> an NT service.
> 
> I need nothing more than to run Medusa as a service. Did
> anybody do this before? Do I need special calls at all?
> 

Blech, well I was working on the minimal code to turn a subclass of
SocketServer into an NT service, when I discovered low and behold, the
WSAEventSelect function isn't exposed anywhere to Python. (WSAEventSelect
allows you to call WaitForMulitpleObject/WaitForSingleObject on a socket)

On top of which, WSAEventSelect makes the socket non-blocking. Blech.

So, hopefully I'll have something nice before I fly to Iowa on Friday.
But what I have will require a rebuild of the win32 extensions. :(

Bill




More information about the Python-list mailing list