telinit

Switch the run level of the currently running system

Supplementary instructions

telinit command is used to switch the running level of the currently running Linux system.

The RUNLEVEL parameter should be one of the multi-user runlevels 2-5, 0 to stop the system, 6 to restart the system, or 1 to put the system into single-user mode.

Typically you would use the shutdown(8) tool to stop or restart the system, or lower it to single-user mode.

RUNLEVEL may also be S or s , which puts the system directly into single-user mode without actually stopping the process first, which you probably don't want.

Change the run level by emitting a runlevel(7) event, which includes the new run level in the RUNLEVEL environment variable and the previous run level in the PREVLEVEL variable (obtained from the environment or /var/run/utmp).

telinit will write the new runlevel to /var/run/utmp and append the new entry to /var/log/wtmp.

grammar

telint(option)(parameter)
telinit [OPTION]... RUNLEVEL

Options

-t: Specifies the number of seconds to wait.
-e key=value

This specifies additional environment variables to be included in the event along with RUNLEVEL and PREVLEVEL.

Parameters

Runlevel: Specify the runlevel to switch.

Environment

RUNLEVEL

If set to take precedence over reading from /var/run/utmp, telinit will read the current runlevel from this environment variable

Files