-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Power-off when shutting down FreeBSD, NetBSD, and OpenBSD #53935
Conversation
@morganwillcock There's actually a unit test for this... but it's pretty crappy. It needs to be changed to make sure the
|
I've searched the documentation and I can't find an obvious answer... |
Should be something like |
@morganwillcock Yeah, I think that's reasonable |
Should I submit this against a different branch? |
@morganwillcock Yes, please - against Alternatively, you can close this PR and just open a new one. Either approach is fine. |
These platforms don't power-off by default when halted.
@waynew I've rebased and switched the target to master |
What does this PR do?
Adds platform checks into the shutdown function of the system execution module, since FreeBSD, NetBSD, and OpenBSD have different shutdown results to other platforms.
What issues does this PR fix or reference?
These platforms don't power-off by default when halted, instead they prompt for input at the console. The system.shutdown currently uses 'shutdown -h' to shutdown these platforms,which means they are not powered off.
Previous Behavior
Calling system.shutdown on a physical minion leaves the hardware powered on. The only way to restart it at this point is by being at the console or by using out-of-band power management.
Calling system.shutdown on a virtual minion leaves the VM using resources on the hypervisor. This can cause excessive CPU usage depending on how the hypervisor deals with the halt state, or lead to later failures when trying to programmatically start the minion (since it is technically still running).
New Behavior
If the platform is FreeBSD, NetBSD, or OpenBSD, use 'shutdown -p' to shutdown, instead of the default 'shutdown -h'. This aligns with the system.shutdown result of other platforms: power off is requested.
Tests written?
Yes?/
NoI imagine this is probably out-of-scope for the test suite?Commits signed with GPG?
Yes/No