Service sometimes won't automatically start on Windows2000 
Author Message
 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.



Tue, 12 Nov 2002 03:00:00 GMT  
 Service sometimes won't automatically start on Windows2000

Quote:
> 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.

I can only suggest you round up the usual suspects.

Is there a conflict with something else? Is the
disk busy with something else? Is the service
fighting for some resource that something else
wants and has locked for part of the bootup?

--
Dan Evens
Standard disclaimers etc. No spam please.



Tue, 12 Nov 2002 03:00:00 GMT  
 Service sometimes won't automatically start on Windows2000

Quote:


>I can only suggest you round up the usual suspects.

>Is there a conflict with something else? Is the
>disk busy with something else? Is the service
>fighting for some resource that something else
>wants and has locked for part of the bootup?

Those are good points. IIRC, unless you specify
that your service needs another service, the order
that services start up isn't guaranteed.

Could one service be need a resource you need,
but when the startup order changes the resource
is already free by the time your service starts?



Wed, 13 Nov 2002 03:00:00 GMT  
 Service sometimes won't automatically start on Windows2000
Thanks Ron and Dan.

I had originally thought that this might be a dependency issue, and
still agree that this is a possibility. I have the same dependencies
setup that I had under Windows NT 4.0 (LanmanServer, EventLog,
LanmanWorkstation, RpcLocator, RpcSs).

I have been looking to see if there are any new services in Win2000
that I perhaps need to have a dependency for as well. I had tried
adding quite a few additional dependencies. I added anything that
remotely looked like it could be a possible dependency. This did not
help. Of course, I may have overlooked the one dependency I really
need. I am going to dig a bit more.

The fact that it does not even look like my apps constructor is entered
leads me to beleive that it is probably not a dependency issue since my
app would not be doing anything yet.

Thanks,

Bob

Sent via Deja.com http://www.deja.com/
Before you buy.



Sat, 16 Nov 2002 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. CInternetSession::OpenURL Won't Dial (Sometimes)

2. CInternetSession::OpenURL Won't Dial (Sometimes)

3. VisualStudio won't automatically re-open source files

4. How to start a application through a Win NT service

5. How to start a application through a Win NT service

6. NT's SCM (for services) and COM's SCM (for locating and starting components)

7. When compiler won't start from IDE...

8. ATL Object Wizard won't start

9. Help please - Dialog-based app won't start - Acc Vio C0000005 - VC 5 - Win200

10. VC5.0 Help won't start

11. ATL Object Wizard won't start

12. eVC++ won't start!

 

 
Powered by phpBB® Forum Software