471,330 Members | 1,827 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,330 software developers and data experts.

daemon under windows

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)?

--
"Now the storm has passed over me
I'm left to drift on a dead calm sea
And watch her forever through the cracks in the beams
Nailed across the doorways of the bedrooms of my dreams"
Nov 14 '07 #1
1 5368
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
Nov 14 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Rob Hunter | last post: by
3 posts views Thread by bmgx | last post: by
1 post views Thread by Bob Swerdlow | last post: by
7 posts views Thread by Michael Ransburg | last post: by
1 post views Thread by Stefan Neumann | last post: by
3 posts views Thread by paul | last post: by
6 posts views Thread by Johny | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.