I set up a Fedora Server box, and set it up in a way so that it automatically logs in (through the OS config), and also automatically restarts after power loss, (through the BIOS). However, when there’s an unexpected power loss, and when the machine later restarts itself, it doesn’t automatically logs in. It gets stopped at the GRUB boot interface, and I have to press ENTER for it to log-in the OS.
How do I enforce grub to automatically log-in, even after such a power loss shutdown ?
Normally it does boot, all automatic (including user login). But when there’s an unexpected power loss, it stops at the Grub menu, in which I have to press enter (because if I wait, it remains at the menu).
As mentioned above, Grub not logs you in. It is just a Menu who gives you options to boot from.
Grub is the boot manager, you use it to boot from EFI or the Legacy way. If you have both options on in BIOS, the system will take what it finds first. If the config is not original Fedora you can have troubles.
I could imagine that your system is smart enough to distinguish between power loss and a clean shutdown.
So to exclude that two different configs kick in I asked you to switch off the one you not need necessarily to boot from your system.
If using uefi to boot BOTH those grub.cfg files are used. The one under /boot/efi is a stub pointer that redirects grub to the actual config file at /boot/grub2/grub.cfg.
I suspect that the halt on boot with a power outage is related to the way the system marks /boot/grub2/grubenv as clean shutdown or not. This halt seems related to grub and the unclean shutdown and appears not to be related to the auto-login at all.
With a clean shutdown the system does not even normally show the grub menu. With a failed previous boot it deliberately displays the grub menu.
Have you verified this behaviour? Because I’ve never seen that. Was it introduced recently? Because as far as I remember, even in the case of a power loss, my system automatically restart and it doesn’t stop indefinitely at the grub menu.
I don’t have a system that I can test it on.
I think I phrased that wrong (and edited the post above), in that I believe grub is intended to display the menu after a failed or incomplete boot. Even then I am not sure it halts indefinitely. It should not halt after a power loss reboot as long as the last boot was successful.
I could see that it might display the menu and possibly halt if the power restore was interrupted with another outage so the first boot did not complete before the power was lost again.
Power outages and storms are the reason Uninterruptable Power Supplies (UPSes) were designed and are used for computers.
Exactly, especially such computers who serve some services and should be available 7/24. In this case a no-break who keeps the system up till a certain time, should be able to power off it gracefully and while power is back bring him up normally again.
The halt should remind to search in the log files what is wrong and correct the bad behavior. At least so server software should work.
We discussed this here once already, I looked for that topic but unfortunately could not find it.
I’m talking about a server (and Fedora Server edition).
If I remove the power cable to the machine, when I power it up again, the GRUB menu appears  and the boot process automatically start after 5 seconds.
For the records, as far as I can see, on Fedora Server the GRUB menu is always showed even in case of a clean shutdown/reboot ↩︎
Yep, i got no problems with the GRUB menu showing if 5 seconds later it was indeed automatically starting. But it doesn’t. Only after power loss, it just remains stuck at the GRUB menu, in which case I have to connect a keyboard and press ENTER for it to start. I really wish I could solve this problem so that it always automatically starts (such as in your machine), which would make my life so much easier Could it be something in the BIOS ?
Howevwer I don’t have this line in /etc/default/grub (btw, by setting it, I don’t notice any difference in my case).
Did you tinkered with the grub configuration?
Could you post the link resulting by this command? sudo fpaste /boot/grub2/grub.cfg