Problem:
Services cannot be started or stopped.Solution:
In some environments, applications installed as Windows services may require more time to start or stop. Click on the links below to learn how to change the timeout for service applications in Windows.A service is unable to start on its own and times out
To avoid the service startup problem (Fig. 1.), you can:- delay the automatic start of the service that causes the problem;
- additionally, you can increase the timeout value for the service startup in the Windows registry.
How to delay the automatic start of a service application
If a service's start is delayed, this service attempts to start only if critical system services have already started. To configure your service this way, you need to:- Run Windows Services manager (launch services.msc from the Start menu).
- Right-click on the service you would like to configure, and select Properties.
- On the General tab, change the Startup type to Automatic (Delayed Start), as shown in Fig. 2. for Exchange Sync.
How to increase the timeout value for the service startup
Additionally, you can change the timeout value for the service startup in the Windows registry:- Launch Windows Registry Editor.
- Find the following registry subkey:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control
- Right-click this key and select New > DWORD (32-bit) Value.
- A new value named New Value #1 appears on the right.
- Change the name of this new value to ServicesPipeTimeout.
- Right-click the ServicesPipeTimeout value you created, and choose Modify. The Edit DWORD Value window opens.
- Change Base to Decimal.
-
In the Value data field, type the value (in milliseconds) of time allowed for the service to start, and click OK.
- Finally, restart the machine.
A service does not stop
If the problem happens for the first time and you are not able to close the service from within Windows Services manager (services.msc) or Task Manager, you can kill the service using the taskkill command. See this Knowledge Base article for details.If the problem occurs frequently, follow the steps below to extend the service closing timeout:
- Launch Windows Registry Editor.
- Locate this registry subkey:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control
- Right-click this key and choose New > DWORD (32-bit) Value.
- A new value named New Value #1 appears in the right pane.
- Rename the new value to WaitToKillServiceTimeout.
- Right-click the value and select Modify. The Edit DWORD Value window pops up.
- Change Base to Decimal.
-
In the Value data field, type the value (in milliseconds) of time allowed for the service to stop, and confirm by clicking OK.
Info
By default, Windows waits 20000 ms, so you might need to set a higher value.
- Finally, restart your machine.