Configure Windows Service Recovery Actions by Default

Configure Windows Service Recovery Actions by Default

2 votes

avatar

The PowerShell Universal Windows service is installed without Windows Service Recovery Actions configured. If the service terminates unexpectedly, it may remain stopped until an administrator intervenes, even though the service startup type is set to Automatic.

This was observed after planned Windows Update restarts. The PowerShell Universal service was stopped as part of the operating system shutdown and later reported by the Service Control Manager as having terminated unexpectedly. Because no recovery actions were configured, Windows did not attempt to start the service again.

This could be prevented if the installer (for example" configures the following recovery actions by default when installing PowerShell Universal on Windows:

  • First failure: restart the service after 60 seconds
  • Second failure: restart the service after 60 seconds
  • Subsequent failures: no action
  • Reset the failure count after 24 hours
  • Enable recovery actions for non-crash failures (FailureActionsOnNonCrashFailures = true)
  • During an upgrade, an existing customer-defined recovery configuration must be preserved. If no recovery actions are configured, the installer should apply the default configuration above.


Expected benefit
This improves service availability after unexpected process termination and planned maintenance restarts, reducing the need for manual recovery.

All Comments (1)

avatar

Thanks for the request! These seem like really useful improvements to service resiliency. I've added a ticket to implement this in a future release.