6.5. My Computer
Won't Stop Rebooting
Newer Linux users are fascinated by the chance
to experiment with different
components
. For the most part, careful
experiments should be encouraged in a test environment. How else
can we learn Linux? But there are mistakes that can annoy the heck
out of us, including the Linux computer that won't stop
rebooting.
Grouped in this section are three low-level
annoyances associated with the boot process:
-
The computer starts and then proceeds to
shutdown without allowing a login.
-
The computer starts and then proceeds to reboot,
continuously.
-
Something weird happens during the boot
process.
These annoyances are normally associated with
configuration problems in boot files. The first two of these
annoyances are straightforward, as they relate to the default
runlevel on your computer. In each of these cases, you'll almost
certainly
have to boot with a rescue disk or a system such as
Knoppix, as described in the previous annoyance.
On occasion, these annoyances may be
related
to
hardware issues. In those cases, you'll see similar behavior when
you use a rescue disk or a system such as Knoppix to boot your
system.
|
Red Hat has the elite certifications in the
world of Linux, including that of the Red Hat Certified Engineer.
One of the RHCE skills listed on the Red Hat web site suggests that
RHCEs need to "diagnose and correct boot failures arising from
bootloader, module, and filesystem errors." Does that sound like it
addresses some of the annoyances in this chapter?
|
|
6.5.1. The
Computer Starts and Then Shuts Down
This annoyance is often easy to fix. Once you've
booted
with a rescue disk and mounted the root directory (/), the
first thing to check is the default runlevel as defined in
/etc/inittab
. If it's
,
as shown here, all you need to do is restore the proper default
runlevel, such as
2
for Debian, or
3
or
5
for Red Hat/Fedora or SUSE:
id:0:initdefault
If the
id
directive isn't set to
, you may have a different problem that's described later
in this annoyance.
6.5.2. The
Computer Starts and Then Reboots
This annoyance is also often straightforward.
Again, boot with an appropriate rescue disk. Proceed by checking
the default runlevel in
/etc/inittab
. If it's 6, as shown here,
restore the proper default runlevel, such as 2 for Debian or 3 or 5
for Red Hat/Fedora or SUSE:
id:6:initdefault
If the
id
variable isn't set to
6
, you may have a different problem described in the
next
section.
6.5.3. Something
Weird Happens During the Boot Process
When Linux boots, it goes through more than just
the
/etc/inittab
file. It reads
the default runlevel and then starts the service scripts as defined
in the associated
/etc/rcx.d
directory. While a problem here normally is associated with a
configuration problem with a service, it's probably not
serious.
If you want to add a program or script to the
boot process, each distribution has a dedicated script in the
/etc
directory for this
purpose.
Alternatively, most distributions have a
user
-definable script. You can use this script to add commands that
you want applied to the computer during the boot process. For
example, if you've configured a wireless network card using
experimental code, you can add the command to start this card to
the script. Various distributions define this script
differently:
-
Red
Hat/Fedora
-
Commands in the
/etc/rc.local
file run after all other init
scripts.
-
SUSE
-
Commands in the
/etc/init.d/boot.local
file run after all
other init scripts.
-
Debian
-
Debian Sarge includes a pointer to
/etc/init.d/local
in all runlevels.
Interestingly enough, this file is missing from the default Debian
configuration. But you can create it and add the commands that you
need.
|