Recipe 7.3. Changing the Default Runlevel

 < Day Day Up > 

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

  • inittab(5)

  • Recipe 7.5

  • Chapter 5 of Running Linux

  • Chapter 10 of LPI Linux Certification in a Nutshell

     < Day Day Up > 


    Linux Cookbook
    Linux Cookbook
    ISBN: 0596006403
    EAN: 2147483647
    Year: 2004
    Pages: 434

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net