LinuxCommandLibrary

systemctl-reboot

Reboot the system immediately

TLDR

Reboot the system

$ systemctl reboot
copy

Reboot into the BIOS/UEFI menu
$ systemctl reboot --firmware-setup
copy

SYNOPSIS

systemctl [OPTIONS...] reboot

PARAMETERS

--no-block
    Do not wait for the operation to finish. The command returns immediately after the reboot request has been sent to systemd, allowing the calling script or user to continue execution while the system prepares to reboot in the background.

--force or -f
    When specified once, this option bypasses the normal graceful shutdown procedure. It causes systemd to immediately terminate all processes and unmount filesystems without invoking shutdown(8). This can be useful in situations where a clean shutdown is stuck or not possible, but it carries a higher risk of data loss.

--force --force
    When specified twice (e.g., systemctl --force --force reboot), this command executes an immediate reboot without even transitioning through different runlevels or targets. This is the most abrupt way to reboot the system and should only be used as a last resort, for example, if the system is completely unresponsive.

DESCRIPTION

The systemctl reboot command is the standard and recommended method for initiating a system restart on Linux distributions that utilize systemd as their init system. As a subcommand of systemctl, it interacts directly with the systemd manager to orchestrate a clean and orderly shutdown of all running services, unmount filesystems, and then reboot the machine.

Unlike older methods or direct kernel calls, systemctl reboot ensures that all system processes are given time to terminate gracefully, minimizing the risk of data corruption or application state loss. This command is part of the systemd suite, which manages the system and service startup process, lifecycle, and shutdown. Its adoption signifies a modern approach to system management, integrating reboot functionality seamlessly within the broader systemd ecosystem for enhanced reliability and control.

It is crucial to save all open work and notify other users if the system is shared before executing this command, as it will disrupt all active sessions and processes. While other commands like reboot or shutdown -r now exist, they often internally invoke systemctl reboot or are considered legacy.

CAVEATS

Requires root privileges or appropriate sudo configuration to execute.
Unsaved data will be lost. Always ensure all critical work is saved before initiating a reboot.
Disrupts all active network connections and user sessions. Inform other users on shared systems before proceeding.
Using --force or --force --force can lead to data corruption if filesystems are not properly unmounted or services are abruptly terminated. Use with extreme caution.

COMPARISON WITH <I>SHUTDOWN -R NOW</I>

While shutdown -r now achieves a similar immediate reboot, systemctl reboot is generally preferred on systemd systems because it directly leverages systemd's internal mechanisms for state transitions, ensuring better integration with service management and logging. shutdown might still be useful for scheduling future reboots.

REBOOT TARGET

When systemctl reboot is executed, systemd activates the reboot.target. This target pulls in other services and targets necessary for a clean shutdown, such as shutdown.target, ensuring that services are stopped in the correct order and filesystems are unmounted before the final reboot instruction is issued to the kernel.

HISTORY

The concept of rebooting a Unix-like system has existed since its inception. Traditionally, commands like reboot and shutdown were used, often interacting directly with the kernel or the init process. With the rise of systemd as the default init system in major Linux distributions (such as Fedora, RHEL, Debian, Ubuntu) starting in the early 2010s, a new paradigm for system management emerged. systemctl was introduced as the primary command-line interface to systemd. The systemctl reboot command supplanted many of the legacy methods by providing a unified, systemd-native way to manage system states, including reboot. This transition aimed to provide more consistent and robust system control, leveraging systemd's sophisticated service management capabilities for a cleaner and more reliable system restart. For backward compatibility, the standalone reboot command is often symlinked to systemctl reboot on systemd-based systems.

SEE ALSO

systemctl(1), poweroff(8), halt(8), shutdown(8), kexec(8)

Copied to clipboard