-
Notifications
You must be signed in to change notification settings - Fork 131
Description
The xService resource cannot currently manage a service's Failure Actions.
The traditional way to set these actions is via sc.exe.
I propose that xService be modified to read the REG_BINARY field FailureActions registry value for the service.
The contents of the field are described in this Stack Overflow Post and Documented by Microsft on the MS Docs Site
I have a start to this functionality working that allows me to read the values from the registry and to compare against a desired state.
The next steps will be to implement settings the values in the registry, and then refactoring the code to make it cleaner and more maintainable.
The new proposed properties for the resource are:
ResetPeriodSeconds - The time after which to reset the failure count to zero if there are no failures, in seconds.
FailureCommand - The command line of the process for the CreateProcess function to execute in response to the SC_ACTION_RUN_COMMAND service controller action.
RebootMessage - The message to be broadcast to server users before rebooting in response to the SC_ACTION_REBOOT service controller action.
Failure1Action
Failure1Delay
Failure2Action
Failure2Delay
Failure3Action
Failure3Delay
The FailureAction represent 3 possible slots for failure actions.
The first two define what to do after first and second failure and the delay in milliseconds to wait before performing the action
The third slot is the action to be performed on subsequent failures that occur within the ResetPeriodSeconds time period.
Valid actions are documented on the MSDocs Site as:
NONE
REBOOT
RESTART
RUN_COMMAND
This issue is a restatement of PowerShell/PSDscResources#83 and PowerShell/PSDscResources#69