Skip to content

Use "net" instead of "sc" to restart minion service - #61383

Merged
Ch3LL merged 2 commits into
saltstack:masterfrom
twangboy:vrae-8756
Jan 13, 2022
Merged

Use "net" instead of "sc" to restart minion service#61383
Ch3LL merged 2 commits into
saltstack:masterfrom
twangboy:vrae-8756

Conversation

@twangboy

Copy link
Copy Markdown
Contributor

What does this PR do?

Uses net instead of sc to restart the salt-minion service on Windows. The net command will not return until it completes, where the sc command just fires the stop or start and returns. That's why there was a 5 second sleep in between the stop and start commands. Sometimes the stop command takes longer than 5 seconds and the start command then fails because the service is still shutting down. Using net avoids this race condition and removes the need for the sleep command.

What issues does this PR fix or reference?

Fixes: https://jira.eng.vmware.com/browse/VRAE-8756

Merge requirements satisfied?

[NOTICE] Bug fixes or features added to Salt require tests.

Commits signed with GPG?

Yes

@twangboy
twangboy requested a review from a team as a code owner December 20, 2021 22:59
@twangboy
twangboy requested review from Ch3LL and removed request for a team December 20, 2021 22:59
@twangboy twangboy added the Phosphorus v3005.0 Release code name and version label Dec 20, 2021
@twangboy twangboy added this to the Phosphorus v3005.0 milestone Dec 20, 2021

@Ch3LL Ch3LL left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This requires a changelog

Comment thread salt/utils/cloud.py
@twangboy

twangboy commented Jan 3, 2022

Copy link
Copy Markdown
Contributor Author

@Ch3LL Added changelog

@twangboy
twangboy requested a review from Ch3LL January 3, 2022 20:32
@Ch3LL
Ch3LL merged commit bcd6426 into saltstack:master Jan 13, 2022
@twangboy
twangboy deleted the vrae-8756 branch March 23, 2023 15:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Phosphorus v3005.0 Release code name and version

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Use NET instead of SC for service management in salt-cloud on Windows

5 participants