11

I've got a bunch of headless servers installed in random (remote) locations all running Ubuntu 11.04. Sometimes the boxes go down and never come back up, eventually someone goes out to check on them to find them sitting at a GRUB screen.

On a normal boot, the machines scream through GRUB with no issue, but it seems like there is some sort of "failsafe" built in that if the machine doesn't boot up properly, the next time the box comes up, it stops at GRUB.

I realize this is for my safety, but due to how the machines are setup, I'd prefer it didn't happen (or at least timeout after a minute or two and try to boot again). Is there anyways to disable this feature?

Jon
  • 632
  • 5
  • 12

2 Answers2

9

Ubuntu has a "cute" (read: annoying) feature where it records a boot failure and sets a grub timeout of -1, disabling auto-boot. You aren't the only one that doesn't like it, see here.

You should be able to work around this by editing /etc/grub.d/00_header, find the section that reads..

if [ "\${recordfail}" = 1 ]; then
  set timeout=-1

..and change it to something sane, like..

if [ "\${recordfail}" = 1 ]; then
  set timeout=10

..then run update-grub.

This file might get reset to default on you during an upgrade of the grub2 package (or the OS), so be careful of that.

Shane Madden
  • 112,982
  • 12
  • 174
  • 248
  • Note in the bug report linked to in this comment, there is a fix released which is back-ported to 12.04 and 11.10. It requires configuration for it to work as described in comments #13 and #14 of that launchpad bug. – Alex Oct 08 '13 at 06:22
1

Since Ubuntu 12.10 (and possibly backported to Ubuntu 12.04) the following will work on Ubuntu:

$ echo GRUB_RECORDFAIL_TIMEOUT=20 | sudo tee -a /etc/default/grub
$ sudo update-grub
$ sudo env DEBIAN_FRONTEND=noninteractive dpkg-reconfigure grub-pc

The above was mentioned by Alex in Oct 2013 in response to Shane Madden's answer of Jan 2012. See comments #13 and #14 on this page:

https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/669481

mpb
  • 223
  • 2
  • 8