Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE REQUEST] Restart Windows service that has dependencies #57987

Open
bsoldhogg opened this issue Jul 20, 2020 · 2 comments
Open

[FEATURE REQUEST] Restart Windows service that has dependencies #57987

bsoldhogg opened this issue Jul 20, 2020 · 2 comments
Labels
Feature new functionality including changes to functionality and code refactors, etc.
Milestone

Comments

@bsoldhogg
Copy link

Is your feature request related to a problem? Please describe.
When attempting to restart a Windows service that has components that are dependent on it, Salt will fail with the error:

ERROR: Failed To Stop winmgmt: A stop control has been sent to a service that other running services are dependent on.

Describe the solution you'd like
Similar to how Powershell handles this with the force flag, I would like Salt to handle the dependencies so the service can be restarted.

Describe alternatives you've considered
At the moment I am using cmd.run with a Powershell command:

Restart-Service winmgmt -Force

Additional context
WinMgmt isn't the service I'm trying to restart but it has dependencies and suffers the same issue. I've poked around win_service.py and I don't see the stop function handling the dependencies, and part of the error message doesn't live in that code, so it looks like this comes from win32serviceutil but that's as far as I can see.

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.

@bsoldhogg bsoldhogg added the Feature new functionality including changes to functionality and code refactors, etc. label Jul 20, 2020
@sagetherage sagetherage added this to the Approved milestone Jul 20, 2020
@knine
Copy link

knine commented Oct 7, 2020

I ran into this today as well for TermService.

@Danduriel
Copy link

Hi, this feature is also discussed in a bug and has been implemented in the develop branch some time ago. Maybe we can get this going again.

Discussed in Bug:
#56431

Pull Request for the issue:
#56574
#56632

Requested Feature implemented in develop
https://github.com/saltstack/salt/blob/develop/salt/modules/win_service.py#L657

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature new functionality including changes to functionality and code refactors, etc.
Projects
None yet
Development

No branches or pull requests

4 participants