I configured for a service two restart actions and a reset period of 60 seconds:
sc failure SPOOLER reset=60 actions=restart/1000/restart/1000//1000
The expectation is, that when the service has been killed twice, there is no more restart performed. However, after starting the service manually again and have it running for at least the reset period, it should be restarted automatically after the next failure.
The behaviour is as expected with Windows Server 2012.
However, with Windows Server 2016 it is different. The service is not restarted after a failure when manually started once the restart actions have been exhausted.
That is a real problem. Imagine starting a service after a change in configuration which leads to a failuer. The service will quickly fail until all restart actions are exhausted. Then you will probably fix the configuration and start the service again manually. The next time the service will fail, no matter how long it has been running successfully, it will not be restarted.
Please find the event logs below.
Did anybody experience the same behaviour? Is that a bug in service manager for Windows 2016?
Event logs Windows Server 2012: Twice the service is restarted by service manager. After the 3rd failure no restart is performed. then, after about 2 minutes later is is restarted manually and killed shortly afterwards -> Automatic restart is performed.
04.12.2018 08:18:42: The Print Spooler service terminated unexpectedly. It has done this 1 time(s). The following corrective action will be taken in 1000 milliseconds: Restart the service.
04.12.2018 08:18:43: The Print Spooler service entered the running state.
04.12.2018 08:18:51: The Print Spooler service terminated unexpectedly. It has done this 2 time(s). The following corrective action will be taken in 1000 milliseconds: Restart the service.
04.12.2018 08:18:52: The Print Spooler service entered the running state.
04.12.2018 08:19:03: The Print Spooler service terminated unexpectedly. It has done this 3 time(s).
04.12.2018 08:19:16: The Print Spooler service entered the running state.
04.12.2018 08:21:24: The Print Spooler service terminated unexpectedly. It has done this 1 time(s). The following corrective action will be taken in 1000 milliseconds: Restart the service.
04.12.2018 08:21:25: The Print Spooler service entered the running state.
Event logs Windows Server 2016: Twice the service is restarted by service manager. After the 3rd failure no restart is performed. Then, after about 3 minutes later is is restarted manually and kill shortly afterwards -> No automatic restart is performed.
12/4/2018 8:02:36 AM: The Print Spooler service terminated unexpectedly. It has done this 1 time(s). The following corrective action will be taken in 1000 milliseconds: Restart the service.
12/4/2018 8:02:37 AM: The Print Spooler service entered the running state.
12/4/2018 8:02:45 AM: The Print Spooler service terminated unexpectedly. It has done this 2 time(s). The following corrective action will be taken in 1000 milliseconds: Restart the service.
12/4/2018 8:02:46 AM: The Print Spooler service entered the running state.
12/4/2018 8:02:53 AM: The Print Spooler service terminated unexpectedly. It has done this 3 time(s).
12/4/2018 8:03:06 AM: The Print Spooler service entered the running state.
12/4/2018 8:05:08 AM: The Print Spooler service terminated unexpectedly. It has done this 1 time(s).