Datasheet
“main” (Installation and Administration) — 2004/6/25 — 13:29 — page 268 — #294
i
i
i
i
i
i
i
i
page 279). After doing so, check whether the system works in the desired
way by entering init 5. If everything turns out as expected, you can use
YaST to set the default runlevel to 5.
Caution
Modifying /etc/inittab
If /etc/inittab is damaged, the system might not boot
properly. Therefore, be extremely careful while editing
/etc/inittab and always keep a backup of an intact ver-
sion. To repair damage, try entering init=/bin/sh after the
kernel name at the boot prompt to boot directly into a shell. After
that, replace /etc/inittab with your backup version using cp.
Caution
11.3 Changing Runlevels
Generally, two things happen when you change runlevels. First, stop
scripts of the current runlevel are launched, closing down some programs
essential for the current runlevel. Then start scripts of the new runlevel are
started. Here, in most cases, a number of programs are started. For exam-
ple, the following occurs when changing from runlevel 3 to 5:
1. The administrator (root) tells init to change to a different runlevel by
entering init 5.
2. init consults its configuration file (/etc/inittab) and determines it
should start /etc/init.d/rc with the new runlevel as a parameter.
3. Now rc calls all the stop scripts of the current runlevel, but only for
those where there is no start script in the new runlevel. In this exam-
ple, these are all the scripts that reside in /etc/init.d/rc3.d/
(old runlevel was 3) and start with a K. The number following K spec-
ifies the order to start, as there are some dependencies to consider.
4. The last things to start are the start scripts of the new runlevel. These
are, in this example, in /etc/init.d/rc5.d/ and begin with an S.
The same procedure regarding the order in which they are started is
applied here.
When changing into the same runlevel as the current runlevel, init only
checks /etc/inittab for changes and starts the appropriate steps (e.g.,
for starting a getty on another interface).
268 11.3. Changing Runlevels










