Many Windows users are familiar with different modes of execution of their operating system:
a. Safe mode
b. Command prompt only
c. Safe mode with network support
d. Safe mode with vga
Runlevel 0 : Is halt mode. Telling init to enter runlevel 0 will cause all processes to be killed off, the filesystems unmounted, and the machine to be halted. This is a perfectly acceptable way to bring down the system. On many laptops and modern desktop computers, this will also cause the machine to be turned off. Different commands to go to runlevel 0.
[edit]
[edit]
a. Safe mode
b. Command prompt only
c. Safe mode with network support
d. Safe mode with vga
And other such options that are presented during the boot-up process. Similarly, Linux has different modes of executing as well, which are known as runlevels. But unlike Windows, we can change runlevels on a fly.
Definition for runlevel : The term runlevel refers to a mode of operation in one of the computer operating system that implement Unix System V-style initialization. This system replaces the traditional /etc/rc and /etc/rc.local scripts used in BSD UNIX. Conventionally, seven runlevels exist, numbered from zero to six, plus an alias runlevel named ‘S’ and/or ‘s’.
Runlevels control services started by the initialization process. The number of runlevels and services started on those runlevels varies with Linux distributions. Information about the runlevels of a particular distribution is listed in file /etc/inittab.
The contents of the file include the following:
D | Name | Description |
---|---|---|
0 | Halt | Shuts down the system. |
1 | Single-user Mode | Mode for administrative tasks. |
2 | Multi-user Mode | Does not configure network interfaces and does not export networks services. |
3 | Multi-user Mode with Networking | Starts the system normally. |
4 | Not used/User-definable | For special purposes. |
5 | Start the system normally with appropriate display manager. ( with GUI ) | As runlevel 3 + display manager. |
6 | Reboot | Reboots the system. |
Runlevel 0 : Is halt mode. Telling init to enter runlevel 0 will cause all processes to be killed off, the filesystems unmounted, and the machine to be halted. This is a perfectly acceptable way to bring down the system. On many laptops and modern desktop computers, this will also cause the machine to be turned off. Different commands to go to runlevel 0.
# halt
# init 0
# telinit 0
# shutdown -h
Now in the above command h is halting and now indicates shutdown the computer now it self no grace/trancision time for example you want to shutdown the command after 60 min so give the below command # shutdown -h +60.
Runlevel 1 : Runlevels 1 and 2 are generally used for debugging purposed only, and are not used during normal operations. Most desktop linux distributions boot into runlevel 5, which starts up the Graphical Login Prompt. This allows the user to use the system with X-Windows server enabled. Most servers boot into runlevel 3, which starts the text based login prompt. Linux runlevels can be changed on the fly using the init tool. If you want to switch from text based operations to the Graphical Interface, you just have to type in ‘telinit 5′ in the root prompt. This will bring up the Graphical Interface in your system. Each runlevel can be configured by the system administrator. The ”/etc/inittab” file has information on which runlevel to start the system at and lists the processes to be run at each runlevel. Each runlevel has its own directory structure where you can define the order in which the services start. These directories are located in the /etc/rc.d/ directory, under which you have rc1.d, rc2.d, rc3.d…. rc6.d.Directories where the number from 0 to 6 that corresponds to the runlevel. Inside each directory are symbolic links that point to master initscripts found in /etc/init.d or /etc/rc.d/init.d. You can also change the runlevel at boot time. If your system uses LILO as the boot manager, you can append the runlevel to the boot command : LILO: linux 3 or LILO: linux 5. If your system uses GRUB, you can change the boot runlevel by pressing the `e’ key to edit the boot configuration. Append the runlevel to the end of the boot command as shown : kernel /vmlinuz ro root=/dev/hda1 5 different linux/unix disterbution’s runlevels
Debian GNU/Linux
Debian, as well as most of the distributions based on it, like early Ubuntu, does not make any distinction between runlevels 2 to 5.
ID | Description |
---|---|
S | Only run on boot (replaces /etc/rc.boot) |
0 | Halt |
1 | Single-user mode |
2-5 | Full Multi-user with console logins and display manager if installed |
6 | Reboot |
[edit]
[edit]
Red Hat Linux and Fedora
Red Hat Linux and Fedora
Code | Information |
---|---|
0 | Halt |
1 | Single-user mode |
2 | Multi-user mode console logins only (without networking) |
3 | Multi-user mode, console logins only |
4 | Not used/User-definable |
5 | Multi-user mode, with display manager as well as console logins (X11) |
6 | Reboot |
[edit]
SUSE Linux
SUSE Linux
SUSE uses a similar setup to Red Hat:
ID | Description |
---|---|
0 | Halt |
1 or S | Single-user mode |
2 | Multi-user mode without networking |
3 | Multi-user mode, console logins only |
4 | Not used/User-definable |
5 | Multi-user mode with display manager |
6 | Reboot |
The services that run under a specific runlevel can be modified with YaST | System Services (runlevel), insserv command or with chkconfig command like the Red Hat based distributions.
No comments:
Post a Comment