
Service sometimes won't automatically start on Windows2000
I have a server type of app that runs as an NT service.
The app class is a subclass of CWinApp. I am of course
calling StartServiceCtrlDispatcher and implementing ServiceMain.
This has been running fine on NT for a number of years (first on NT
3.5.1 and then on NT 4.0)
It runs fine on Windows2000 as well. However, on Windows2000 (release
build 2195) it sometimes fails to start as an automatic service at boot
time.
When this occurs, the Service Control Manager logs the following to the
Event Log:
- Timeout (30000 milliseconds) waiting for the XXX service to
connect.
- The XXX service failed to start due to the following error:
The service did not respond to the start or control request in a timely
fashion.
This does not happen all of the time. It is intermittent.
I have never seen this happen when automatically starting my service on
NT 4.0
The app is built with VC++ 6.0 (SP3 applied) on a NT 4.0 (SP5) machine.
I added some code to log an event to the event log (my service has a
dependency on the EventLog) and also write to a file when the
constructor of my app (subclass of CWinApp) is entered. When the
problem occurs, it does not appear that the constructor is even entered.
Any ideas?
Thanks in advance,
Bob Rozwod
Sent via Deja.com http://www.*-*-*.com/
Before you buy.