Guidelines for Services
Services should adhere to these guidelines to ensure that the Restart Manager can shut down and restart services if necessary to install updates. Applications can use the guidelines that are described in Guidelines for Applications.
Services should be capable of being shut down and restarted using the Service Control Manager without requiring a system restart. The exceptions to this guideline are critical system processes that run in the context of lsass.exe or services.exe.
Restart Manager honors service dependencies. When a service is shut down and restarted, its dependent services are shut down and restarted.
Services should specify the recovery interval and reset period in the Service Control Manager (SCM). The recovery interval is the time, in msecs, after the last failure that the SCM waits before taking the recovery action. The reset period is the time, in seconds, after the last failure that the Service Control Manager waits before resetting the failure count to 0. Services can use ChangeServiceConfig2 function to change the configuration settings.
Critical services should use the following recovery settings to specify that the service be restarted one minute after the first failure to restart the service, restarted two minutes after the second failure, and that the computer be restarted one minute after the third failure. The failure count is reset to 0 after 300 seconds.
- Recovery Actions: Restart/60000/Restart/120000/Reboot/60000 & Reset =300
Critical services should be started before non-critical services. Services that are not critical services should use the following recovery settings to specify that the service be restarted two minutes after the first failure to restart the service. The service is not restarted after the second failure, and an administrator would need to intervene in this case. The failure count is reset to 0 after 900 seconds.
- Recovery Actions: Restart/120000/Restart/300000/None/0 & Reset = 900