Skip to content

xService Cannot Manage Failure Actions #678

@RandomNoun7

Description

@RandomNoun7

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementThe issue is an enhancement request.in progressThe issue is being actively worked on by someone.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions