how-to block ads
•State 0 is the halt state. When you switch a system to state 0, it will shutdown immediately.
•State 1, known as the administrative state, allows access only to a super-user. Using this state, a system administrator can perform various maintenance operations and installations without interference from other users.
•State 2 is the partial multiple user state. It allows multiple users to login but it disables remote file sharing.
•State 3 is the multiple user state. It allows multiple users to login and enables remote file sharing. This is the default state for the command line interface.
•State 4 is unused.
•State 5 is the default state for graphical logins that use display managers such as gdm and xdm. If you choose to use graphical logins during the installation process, this will be your default state instead of state 3, which would be the default otherwise.
•State 6 shuts down the system and reboots (note that state 0 shuts down the system without performing an automatic reboot afterwards).
•State s or S is the single-user state. It restricts the number of logged in users to one.
Detecting and Setting the System's State
To detect the state in which your system is currently running, use the runlevel command (the term 'runlevel' is a synonym for 'state'). For example:
On startup, Linux enters the default state. The system's default state is stored in a file called /etc/inittab. You may override it by changing the value of the init default entry. To change the current
system state, use the init command. For example, to switch to a single-user mode, type the following command:
Likewise, to shut the system down immediately, use the following command:
Note, however, that, in general, you should use the 'shutdown' command. It allows you to include a warning message that is sent to all the users that are currently logged in or specify a delay.