Results 1 to 4 of 4

Thread: The Linux System Runlevels

  1. #1

    THe Linux System Runlevels

    This is my first tutorial (consider this when commenting), and hope is helpfull to you, comments and suggestions are welcomed.
    So without taking much of your time, lets start the tutorial.

    =================================
    The Linux System Runlevel tutorial by: Gigabite
    -----------------------------------------------------------

    COPYRIGHT

    Copyright (C) 2003 Gigabite All rights reserved

    You may distribute this tutorial freely, as long as no changes are made to the document. The copyright, disclaimer and the signature MUST be included with the document.

    DISCLAIMER

    Although I have taken every precaution in the preparation of this tutorial, I will assume no responsibility for errors or omissions. Neither is any liability assumed for the information contained herein.

    PLEASE IF YOU FIND THE TUTORIAL USEFULL, GIVE ME CREDIT BY GIVING ME GREENIES

    ***BOF***

    -The linux system can run in different satates, depending o the capabilities you want to give it. These states (They are also known as modes) are referred to as runlevels , the level of support that you are running your system at.

    -The Linux System has several runlevels, numberedfrom 0 to 6. When the system is powered up, it enteres the default runlevel. You can then change to other runlevels with the telinit command.

    System runlevels (states)

    0 Halt (do not set the default to this ); this shuts down the system completely.

    1 Administrative single user mode; denies other users access to the system, but
    allow root access to the entire multiuser filesystem.

    2 Multiuser, without networking services like NFS, xinetd, and NIS (the same as 3,
    but you do not have networking.

    3 Full multiuser mode with login to command line interface; Also referred to as
    the text mode state

    4 Unused level.

    5 Full multiuser mode that starts up in an X session, iitiating a graphical login.
    (same as 3, but with graphical login).

    6 Reboots; shuts down and restarts the system (do not set the default to this ).


    -When the system startsup, it uses the default runlevel as specified in the default init entry in the /etc/inittab file. For example if your default init runlevel is 5 (the graphical loin), the default init entry in the /etc/inittab would be:

    init:5:default

    -You can change the default runlevel by editing the /etc/inittab file and changing the init default entry.

    -You can use the runlevel command to see what state youarecurrently in. It will list the previous state followed by the current one. If you have not changed states, the previous state will be listed as N , indicating no previous change. For example:

    # runlevel
    N 3

    -Although you can power down the system with the telinit command and the 0 state, you can also use the shutdown command. The shutdown command has a time argument that gives users on the system a warning before you power down.
    You can specify an exact time to shut down or a period of minutes from the current time. The exact time is specified by hh:mm for the hour and minutes. The period time is indicated by a + and the number of minutes.
    For example the following command will shutdown the system after ten minutes:

    # shutdown -h +10

    ***EOF***

    Gigabite
    The FACT that people ignore FACTS
    doesnt mean that FACTS are not FACTS

  2. #2
    Banned
    Join Date
    May 2003
    Posts
    1,004
    You supplied the most common but by no means universal runlevels. For example some SuSE releases use:

    0 : halt
    S : single-user
    1 : multi user
    2 : multi-user + network
    3 : x windows/agetty
    4 : unused
    5 : unused
    6 : reboot

    And some RedHat releases use:

    0 : halt
    1 : single-user
    2 : user defined
    3 : multi-user + network
    4 : user defined
    5 : x windows/agetty
    6 : reboot

    Also, you might want to add a bit about adding and removing services to specific runlevels, putting your start-up scripts in your init.d directory, and setting up your symbolic links, and configuring the script loading order. This is all very important to really understanding/using runlevels to their full potential.

    catch

  3. #3
    catch thanx for ur comment, i will consider ur points.

    The FACT that people ignore FACTS
    doesnt mean that FACTS are not FACTS

  4. #4
    AO Antique pwaring's Avatar
    Join Date
    Aug 2001
    Posts
    1,409
    That's the problem with different distros, they often use slightly different run levels. However, AFAIK, the following runlevels are standard across all *nix systems:

    0: halt
    1: single user
    3: multi-user, console login
    5: multi-user, graphical login
    6: reboot

    The others might be configured by a particular distro or even the user, but I've never come across any *nix distro (and I've used a lot of different ones) that don't adhere to the five standard runlevels listed above.
    Paul Waring - Web site design and development.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •