Previous Section  < Day Day Up >  Next Section

Recipe 7.3. Changing the Default Runlevel

7.3.1 Problem

You don't like the runlevel your system boots to, and you want to change it. For example, you might boot into text-mode rather than a nice window system. Or perhaps you have customized different runlevels to run different sets of services, and after a suitable amount of testing and tweaking, you're ready to choose one for a default.

7.3.2 Solution

Easy as pie. Edit /etc/inittab, and look for this line:

# The default runlevel.

id:2:initdefault:

Simply change id:2 to whatever number you desire (except 0 or 6).

If you're commitment-shy and want the most flexibility at boot time, comment out the id:X:initdefault line. Then init will ask you during bootup which runlevel you want.

7.3.3 Discussion

Debian's default 2-5 runlevels are all the same and will boot either to a text console or a graphical login manager, depending on what was selected at installation. Runlevel 2 is the Debian default. Recipe Recipe 7.5 tells how to customize Debian's runlevels.

7.3.4 See Also

    Previous Section  < Day Day Up >  Next Section