(#2053273) Let SysV compat. shutdown commands honor inhibitors for root#355
Merged
systemd-rhel-bot merged 4 commits intoredhat-plumbers:masterfrom Feb 16, 2023
Conversation
Member
Author
|
@msekletar It just occurred to me that there's an easier--and safer--way than trying to make the new code backwards-compatible again. Given that the changes are in a single function |
Member
|
That sounds much better. Please try to implement it this way so we know how exactly would resulting code look. |
The code at this point is not able to tell whether it was called as halt/poweroff/reboot or shutdown with time "now". The code also takes a shortcut to skip logind if called as root. That however means asking shutdown for immediate action won't trigger a wall message. As per systemd/systemd#8424 (comment) all commands should trigger a wall message. That simplifies the code as we can try logind first always. (cherry picked from commit adefc87) Resolves: #2053273
For shutdowns don't fall back to starting the target directly if talking to logind failed with auth failure. That would just lead to another polkit auth attempt. (cherry picked from commit 38d55bf) Related: #2053273
RHEL-only Related: #2053273
Currently, the legacy shutdown commands ignore inhibitors and reboot immediately if run by root. Let's preserve that behavior in RHEL-8 by default. The new behavior can be turned on by those who want it by exporting SYSTEMD_NEW_SHUTDOWN=1 . RHEL-only Related: #2053273
a463521 to
0c6a303
Compare
Member
Author
|
Done. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves: #2053273