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

fix(dracut-lib): use poweroff instead of halt #2332

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

lnykryn
Copy link
Member

@lnykryn lnykryn commented May 10, 2023

Using halt will keep the HW still powered on. This can be confusing for users. The screen is blank, but for example, the fan is still running, and they have no idea what is going on. So let's call poweroff.

@github-actions github-actions bot added base Issues related to the base module modules Issue tracker for all modules labels May 10, 2023
@LaszloGombos
Copy link
Collaborator

This looks good to me, but for consistency should the following change as well to poweroff instead of halt (in dracut-lib.sh).

source_hook "$hook"                                                                                                                                                                                  
warn "$action has failed. To debug this issue add \"rd.shell rd.debug\" to the kernel command line."                                                                                                 
[ -z "$_emergency_action" ] && _emergency_action=halt      

Copy link
Member

@aafeijoo-suse aafeijoo-suse left a comment

Choose a reason for hiding this comment

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

I see this was done on purpose in e2ecc2d8, unfortunately we don't have access to https://bugzilla.redhat.com/show_bug.cgi?id=1053655 :)
Maybe to (at least) see some info on the screen of what caused the die(), instead of power off the display?

@lnykryn
Copy link
Member Author

lnykryn commented May 10, 2023

This looks good to me, but for consistency should the following change as well to poweroff instead of halt (in dracut-lib.sh).

source_hook "$hook"                                                                                                                                                                                  
warn "$action has failed. To debug this issue add \"rd.shell rd.debug\" to the kernel command line."                                                                                                 
[ -z "$_emergency_action" ] && _emergency_action=halt      

Fixed

I see this was done on purpose in e2ecc2d8, unfortunately we don't have access to https://bugzilla.redhat.com/show_bug.cgi?id=1053655 :)
I made that one public

Maybe to (at least) see some info on the screen of what caused the die(), instead of power off the display?
Well, even if so it does not work:) see https://bugzilla.redhat.com/show_bug.cgi?id=2192822

Copy link
Collaborator

@LaszloGombos LaszloGombos left a comment

Choose a reason for hiding this comment

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

LGTM

I like the idea of adding a few (30?) seconds delay before poweroff for the user to see what has happened on the screen and what is about to happen, but I would not wait for user input before issuing the shutdown. This could be done as a follow-up patch.

There is no very good solution here and poweroff is less confusing than halt. For some remote/unattended setup this could even damage the HW.. perhaps poweroff at least safer for the HW.

Copy link
Member

@aafeijoo-suse aafeijoo-suse left a comment

Choose a reason for hiding this comment

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

This would also need to be changed:

[ -z "$_emergency_action" ] && _emergency_action=halt

IMHO if we replace halt with poweroff, we should add the delay proposed by @rmetrich, so that the message passed to die can at least be seen, otherwise that message would be meaningless.

@lnykryn
Copy link
Member Author

lnykryn commented May 11, 2023

Sure, we can do a follow-up with sleep. I think thirty seconds is a bit too much; ten should be enough.

Using halt will keep the HW still powered on. This can be confusing for
users. The screen is blank, but for example the fan is still
running and they have no idea what is going on. So let's call poweroff.
@LaszloGombos
Copy link
Collaborator

@aafeijoo-suse what do you think of the latest version of this PR ?

@LaszloGombos LaszloGombos modified the milestones: dracut-060, dracut-061 Oct 30, 2023
@AdamWill
Copy link
Contributor

This is a problem for https://bugzilla.redhat.com/show_bug.cgi?id=2246410 . See also #2545 .

Ten seconds seems waaaaay too short to me. In general, boot takes a while; people get bored and go to do something else while it's happening. For the specific case of media check, it takes longer. You can't assume someone will stay glued to the screen during the process such that they will catch a message that appears for ten seconds before the system suddenly shuts down.

I'd think ten minutes at least is the flat minimum to be reasonably sure someone caught the message.

@aafeijoo-suse aafeijoo-suse removed this from the dracut-061 milestone Nov 18, 2023
@LaszloGombos
Copy link
Collaborator

LaszloGombos commented Mar 12, 2024

We also have "rd.debug" in our toolbox. I think dracut already recommends setting "rd.debug" to debug dracut issues for the NOT unattended case.

Users should not just reboot and try again. They should reboot set "rd.debug" in the bootloader and try again instead.

Perhaps if "rd.debug" is NOT set, poweroff is still the best possible action (with not much of a wait).
If and only if "rd.debug" is set, having a long timeout (or even waiting for input before taking an action) is very reasonable.

Crossposted also at #2545 .

Copy link

stale bot commented Apr 22, 2024

This issue is being marked as stale because it has not had any recent activity. It will be closed if no further activity occurs. If this is still an issue in the latest release of Dracut and you would like to keep it open please comment on this issue within the next 7 days. Thank you for your contributions.

@stale stale bot added the stale communication is stuck label Apr 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
base Issues related to the base module dracut-systemd Issues related to the dracut-systemd module modules Issue tracker for all modules stale communication is stuck
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants