Microsoft KB Archive/203878

{|
 * width="100%"|

INFO: Service Dependencies Not Used During Shutdown

 * }

Q203878

-

The information in this article applies to:


 * Microsoft Windows NT Server
 * Microsoft Windows NT Workstation
 * Microsoft Windows 2000 Advanced Server
 * Microsoft Windows 2000 Server
 * Microsoft Windows 2000 Professional

-

SUMMARY
When a service is dependendent on other services, the Service Control Manager (SCM) will automatically start the dependencies before starting the dependent service itself. However, during system shutdown, the SCM does not take dependencies into consideration when stopping services. It simply enumerates the list of running services and sends a SERVICE_CONTROL_SHUTDOWN command to all of them. Thus, a service may stop responding or fail because another service it depends upon has already stopped.

MORE INFORMATION
To learn more about service dependencies, refer to the Win32 SDK documentation in the latest version of the MSDN Library. Note that the lpDependencies parameter passed to CreateService and ChangeServiceConfig is only documented for use in starting services.

The documentation for the Handler function (specified in RegisterServiceCtrlHandler) contains a remark for SERVICE_CONTROL_SHUTDOWN stating that a service should only perform limited processing during shutdown because there is limited time available. By default, the service shutdown limit is 20 seconds. For additional information on how you can increase this time limit, click the article number below to view the article in the Microsoft Knowledge Base:

"Q146092 How to Increase Shutdown Time For Services To Close Properly" The main purpose for the 20-second shutdown limit is that the shutdown may have occurred due to a power failure and the Uninterruptible Power Supply (UPS) can run out of battery power during shutdown. In addition, this limit improves the overall responsiveness to the user-initiated shutdown.

Additional query words: kbDSupport prodnt

Keywords : kbinterop kbKernBase kbOSWinNT kbOSWin2000 kbService kbSvcMgr _IK

Issue type : kbinfo

Technology : kbWinNTsearch kbWinNTWsearch kbwin2000AdvServ kbwin2000AdvServSearch kbwin2000Serv kbWinNTSsearch kbwin2000ServSearch kbwin2000Search kbwin2000ProSearch kbwin2000Pro kbWinAdvServSearch