The telinit command is used to change the runlevel of a Linux system. The runlevel is a number that represents the current state of the system. For example, runlevel 0 is halt, runlevel 1 is single-user mode, and runlevel 2 is multi-user mode.
To change the runlevel with telinit, you can use the following syntax:
telinit <runlevel>For example, to change the runlevel to 3 (multi-user mode), you would use the following command:
telinit 3You can also use the -f option to force the change of runlevel, even if there are running services that would normally prevent the change. For example, to force the change to runlevel 3, you would use the following command:
telinit -f 3The following table lists the available runlevels:
| Runlevel | Description |
|---|---|
| 0 | Halt |
| 1 | Single-user mode |
| 2 | Multi-user mode |
| 3 | Full multi-user mode |
| 4 | Not used |
| 5 | Graphical mode |
| 6 | Reboot |
| S | Same as runlevel 1, but used for system maintenance |
The default runlevel is usually set in the /etc/inittab file. You can change the default runlevel by editing this file.