[FEATURE REQUEST] win_service.py add service failure actions
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 15.7k
- Forks
- 5.6k
- Avg merge
- 2d 44m
- Merged PRs (30d)
- 80
Description
Is your feature request related to a problem? Please describe.
I have many services, salt-minion included, that don't install with the failure options that I want. I have to manage this configuration outside of salt because win_service.modify doesn't have an argument for failure options
Describe the solution you'd like
Add an argument (or arguments) to win_service.modify that allow for the changing of the failure_actions.
Describe alternatives you've considered
Doing this outside of salt.
Additional context
This could be accomplished with something like:
if failure_action is not None:
failure_action = eval(failure_action)
if list(failure_action.keys()) == ['ResetPeriod', 'RebootMsg', 'Command', 'Actions']:
win32service.ChangeServiceConfig2(handle_svc, win32service.SERVICE_CONFIG_FAILURE_ACTIONS, failure_action)
changes["failure_action"] = failure_action
else:
changes["Warning"] = "failure_action: requires a dictionary containing: 'ResetPeriod', 'RebootMsg', 'Command', 'Actions'"
it also requires win32service.SERVICE_ALL_ACCESS when initializing handle_svc
Please Note
If this feature request would be considered a substantial change or addition, this should go through a SEP process here https://github.com/saltstack/salt-enhancement-proposals, instead of a feature request.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in win_service.py at win_service.modify and inspect how handle_svc is initialized and how existing configuration changes are reported. Read the referenced win32service failure-actions API and determine the input shape and access requirements; done means modify can accept and apply failure actions with appropriate validation or warnings.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- infrastructure
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100