daemon under windows

"Martin v. Löwis" martin at v.loewis.de
Wed Nov 14 14:56:35 EST 2007


> I wrote a simple UNIX daemon (using 2 forks) which does a simple job: it 
> executes a function, waits for some time, and then executes it again. Now 
> I'd like to port that to Windows. How do I create daemon on Windows (since 
> I can't use fork)?

On Windows, you develop "services". They are under the control of the
"service control manager", and can be managed through the "services"
control panel application, and the "net start/stop" command line
utility.

In that architecture, you don't need fork to start a background
process, but instead, you register your service with the system, and
it will get started automatically (if you wish so) or manually
(through the management interface).

You can use the Win32 extensions to create services, with the
win32serviceutil module.

HTH,
Martin



More information about the Python-list mailing list