Chapter 4. Shutting down, suspending, and hibernating the system


To administer and manage data and settings on a system, use the systemd power management options. It includes tasks such as managing power consumption, performing proper system shutdowns to protect your data, and restarting the system to apply changes and updates.

4.1. Scheduling a system shutdown

To perform maintenance tasks and apply updates to applications, you can schedule a delayed shutdown by using the shutdown command. It is important to schedule a shutdown for system maintenance tasks to avoid data loss and unexpected system failures.

Prerequisites

  • You have administrative privileges.

Procedure

  • Shut down the system and power off the machine at a certain time:

    # shutdown --poweroff hh:mm
    Copy to Clipboard Toggle word wrap

    Where hh:mm is the time in the 24-hour time notation. To prevent new logins, the system creates the /run/nologin file 5 minutes before the shutdown.

    When you specify time of the shutdown command, you can notify users logged in to the system of the planned shutdown by specifying an optional wall message. For example:

    # shutdown --poweroff 13:59 "Attention. The system will shut down at 13:59"
    Copy to Clipboard Toggle word wrap
  • Shut down and halt the system after a delay, without powering off the machine:

    # shutdown --halt +m
    Copy to Clipboard Toggle word wrap

    Where +m is the delay time in minutes. You can use the now keyword as an alias for +0.

  • Cancel a pending shutdown:

    # shutdown -c
    Copy to Clipboard Toggle word wrap

    For details, see shutdown(8) man page on your system.

To administer and manage data and settings on a system, use the systemd power management options. You can shut down the system and power off the machine or shut down and halt the system without powering off the machine by using the systemctl command.

Prerequisites

  • You have administrative privileges.

Procedure

  • Shut down the system and power off the machine:

    # systemctl poweroff
    Copy to Clipboard Toggle word wrap
    • Use the --when option with the systemctl poweroff command to specify time:

      # systemctl poweroff --when="+15min"
      Copy to Clipboard Toggle word wrap
      Note

      By default, running either of these commands causes systemd to send an informative message to all users that are currently logged into the system.

      To prevent systemd from sending this message, run the selected command with the --no-wall command line option.

4.3. Restarting the system

To apply pending changes and updates, you can restart the system by using the systemctl command. When you restart the system, systemd stops all running programs and services, the system shuts down, and then starts again immediately.

Prerequisites

  • You have administrative privileges.

Procedure

  • Restart the system:

    # systemctl reboot
    Copy to Clipboard Toggle word wrap
    Note

    By default, running this command causes systemd to send an informative message to all users that are currently logged into the system.

    To prevent systemd from sending this message, run this command with the --no-wall option.

To save the current system state and reduce power consumption, you can suspend, hibernate, suspend-then-hibernate, or hybrid sleep the system by using the systemctl command.

  • To suspend the system, run:

    # systemctl suspend
    Copy to Clipboard Toggle word wrap

    Suspending saves the system state in RAM and powers off most devices, except the RAM module. When you turn the machine back on, the system restores its state from RAM without rebooting. Restoring from suspend mode is significantly faster than from hibernation because this operation saves the state in RAM, not on disk. However, the suspended system state is vulnerable to power outages.

  • To hibernate the system, enter:

    # systemctl hibernate
    Copy to Clipboard Toggle word wrap

    Hibernating saves the system state on the hard disk drive and powers off the machine. When you turn the machine back on, the system restores its state from the saved data without rebooting. Restoring from hibernation is significantly slower than from suspend mode because this operation saves state on disk, not in RAM. However, the machine does not have to keep electrical power to the RAM module.

  • To hibernate and suspend the system, enter:

    # systemctl hybrid-sleep
    Copy to Clipboard Toggle word wrap

    Hybrid sleep combines hibernation and suspend. The system saves the current state to disk and enters a low-power state, allowing faster resume. If there is power loss during the sleep operation, the system recovers the state from the saved disk image, similar to hibernation.

  • To suspend and then hibernate the system, run:

    # systemctl suspend-then-hibernate
    Copy to Clipboard Toggle word wrap

    This mode first suspends the system, saving the state to RAM in low-power mode. If the system remains suspended for a duration you define in HibernateDelaySec, it then hibernates. Hibernation saves the state to the hard disk and powers off the system completely. This mode conserves battery power while enabling quick resume. It also protects your data during power failures.

To prevent the system from shutting down when you press the power button, you need to modify settings for the non-graphical systemd target. Select the option according to requirement.

Prerequisites

  • You have administrative privileges.

Procedure

  1. Edit the /etc/systemd/logind.conf configuration file to set the HandlePowerKey variable.
  2. To reboot the system when you press the power button, set the reboot value:

    HandlePowerKey=reboot
    Copy to Clipboard Toggle word wrap

    Use one of the following options:

    • poweroff: Shut down the computer.
    • reboot: Reboot the system.
    • halt: Initiate a system halt.
    • kexec: Initiate a kexec reboot.
    • suspend: Suspend the system.
    • hibernate: Initiate system hibernation.
    • ignore: Do nothing.
  3. Restart the systemd-logind service to apply the changes:

    # systemctl reload systemd-logind
    Copy to Clipboard Toggle word wrap

To prevent the system from suspending when you press the power button, modify settings for the GNOME login screen and user session. You can select one of the options: physically on a system or virtually from a remote console.

Prerequisites

  • You have administrative privileges.

Procedure

  1. Create a local database for system-wide settings in the /etc/dconf/db/local.d/01-power file:

    [org/gnome/settings-daemon/plugins/power]
    power-button-action=<value>
    Copy to Clipboard Toggle word wrap

    Replace <value> with one of the following power button actions:

    • nothing: Does nothing.
    • suspend: Suspends the system.
    • hibernate: Hibernates the system.
    • interactive: Shows a pop-up query asking the user what to do.

      In the interactive mode, when you press the power button, the system automatically powers off after 60 seconds. You can select a different behavior from the pop-up query.

  2. Optional: To override existing settings and prevent other users from changing it, edit configuration in the /etc/dconf/db/local.d/locks/01-power file:

    /org/gnome/settings-daemon/plugins/power/power-button-action
    Copy to Clipboard Toggle word wrap
  3. Update the system databases:

    # dconf update
    Copy to Clipboard Toggle word wrap
  4. Log out and log in again for the system-wide settings to take effect.

Verification

  • Press the power button and check if the system performs the action you configured.
Red Hat logoGithubredditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust. Explore our recent updates.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

Theme

© 2026 Red Hat
Back to top