LinuxCommandLibrary

telinit

Change system runlevel

TLDR

Power off the machine

$ telinit 0
copy

Reboot the machine
$ telinit 6
copy

Change SysV run level
$ telinit [2|3|4|5]
copy

Change to rescue mode
$ telinit 1
copy

Reload daemon configuration
$ telinit q
copy

Do not send a wall message before reboot/power-off (6/0)
$ telinit --no-wall [value]
copy

SYNOPSIS

telinit [RUNLEVEL]

PARAMETERS

0
    Halt the system (power off).

1 or S/s
    Single-user mode. Used for system maintenance or rescue operations.

2
    Multi-user mode without NFS (Network File System) services. Often a text-only mode.

3
    Full multi-user mode, text-only. This is a common default runlevel for servers.

4
    Unused or user-definable runlevel. Not typically configured by default.

5
    Full multi-user mode with graphical desktop. This is the common default runlevel for desktop systems.

6
    Reboot the system.

Q or q
    Re-examine the /etc/inittab file. This reloads the configuration for the init process (primarily for SysVinit).

DESCRIPTION

telinit is a command used to instruct the init process to change the system's runlevel. Runlevels define the operating mode of the system, ranging from single-user mode to multi-user mode with full networking and graphical interfaces.

Historically, init (PID 1) was the first process started by the kernel and responsible for managing system boot, shutdown, and runlevels based on the /etc/inittab file. telinit acts as a frontend to send signals to this init process.

On modern Linux distributions that use systemd, telinit is often provided as a compatibility symlink to systemctl, which translates runlevel requests into systemd target changes (e.g., runlevel 5 maps to graphical.target). While it still functions, systemctl isolate or systemctl set-default are the native and preferred methods for managing system states in systemd environments. Executing telinit typically requires superuser privileges.

CAVEATS

Requires root (superuser) privileges to execute.
On systemd-based distributions, telinit is a legacy command. While it often works due to compatibility layers, systemctl isolate is the native and preferred command to change targets (equivalent to runlevels).
Changing runlevels drastically alters the system's state and can interrupt services or active users; use with caution.

DEFAULT RUNLEVELS

The default runlevel is typically configured in the /etc/inittab file (for SysVinit) or as the default boot target (for systemd). Common defaults are:
Runlevel 3: Text-mode server (no GUI).
Runlevel 5: Graphical desktop environment.

SYSTEMD EQUIVALENCE

On systemd systems, runlevels map to specific systemd targets:
Runlevel 0: poweroff.target
Runlevel 1/S/s: rescue.target
Runlevel 2: multi-user.target (often)
Runlevel 3: multi-user.target
Runlevel 5: graphical.target
Runlevel 6: reboot.target
Using systemctl isolate is the direct systemd equivalent.

HISTORY

telinit is historically part of the sysvinit package, which provides the traditional System V-style init system. For decades, init was PID 1 on Linux and Unix-like systems, managing the entire boot process, daemon startup, and system runlevels based on the /etc/inittab configuration file.

The telinit command was developed as a standard interface for users (specifically, administrators) to communicate with the running init process to request a change in the system's runlevel. Its usage became synonymous with system state management.

With the rise of newer init systems like Upstart and, more predominantly, systemd, the role of init and its direct configuration file /etc/inittab has been largely superseded. However, to maintain backward compatibility, systemd often provides a telinit executable (usually a symbolic link to systemctl) that translates the traditional runlevel requests into systemd 'target' changes, ensuring that older scripts and muscle memory can still function.

SEE ALSO

init(8), runlevel(8), shutdown(8), systemctl(1), inittab(5)

Copied to clipboard