Just wanted to share this with anyone wanting to know.
If your headless server
crashes, GRUB2 (at least on Ubuntu Server) is designed to force the GRUB menu to
load up next time it starts up, which means you are locked out of SSH until someone physically makes a kernel selection on the PC.
To prevent this do the following change to your grub.cfg file.
#nano /boot/grub/grub.cfg
You want to find this line and change it:
Code:
if [ ${recordfail} = 1 ]; then
set timeout=-1
else
set timeout=10
fi
And change to:
Code:
if [ ${recordfail} = 1 ]; then
set timeout=3
else
set timeout=10
fi
Or a number other than -1.
when install new kernel image, the system will update this grub.cfg file. Therefore, you also need to change the /etc/grub.d/00_header, find the following function:
Code:
make_timeout ()
{
cat << EOF
if [ "\${recordfail}" = 1 ]; then
set timeout=1
else
set timeout=${2}
fi
EOF
}
So we need to change "set timeout=-1" to "set timeout=1" as well.
Also, please enable the "auto answering feature" for fsck:
/etc/default/rcS
Quote:
cat /etc/default/rcS
#
# /etc/default/rcS
#
# Default settings for the scripts in /etc/rcS.d/
#
# For information about these variables see the rcS(5) manual page.
#
# This file belongs to the "initscripts" package.
TMPTIME=0
SULOGIN=no
DELAYLOGIN=no
UTC=yes
VERBOSE=no
FSCKFIX=no |
it is enough to change FSCKFIX=no => FSCKFIX=yes