LinuxCommandLibrary

systemctl-suspend-then-hibernate

Suspend, then hibernate system

TLDR

Suspend the system and hibernate after the configured delay

$ systemctl suspend-then-hibernate
copy

Force suspend-then-hibernate (bypass inhibitor locks)
$ systemctl suspend-then-hibernate [[-f|--force]]
copy

SYNOPSIS

systemctl suspend-then-hibernate [OPTIONS...]

PARAMETERS

-i, --interactive
    Ask user confirmation before proceeding

--no-wall
    Do not send wall message before suspending

--no-block
    Do not wait for completion, return immediately

--dry-run
    Simulate actions without executing

--force
    Force operation despite inhibitors

--message=<string>
    Custom wall message

--wall
    Send wall message before suspending (default)

-H, --host=<host>
    Operate on remote host

-M, --machine=<container>
    Operate on local container

DESCRIPTION

The systemctl suspend-then-hibernate command instructs systemd to suspend the system to RAM (shallow sleep). After a configurable delay (default HibernateDelaySec= from /etc/systemd/sleep.conf, typically 30 minutes), the system wakes briefly and transitions to hibernation (deep sleep to disk). This hybrid mode balances quick resume from RAM with safe persistence to disk if suspend is prolonged, preventing data loss from power failure.

It requires proper hibernation setup: sufficient swap (≥ RAM size), kernel command line with resume=UUID=... pointing to swap, and resume hook in initramfs. Without this, it falls back to suspend only.

Ideal for laptops where battery might drain during suspend. Unlike hybrid-sleep (hibernate first, then suspend), this prioritizes fast suspend with delayed backup hibernation.

Triggers suspend-then-hibernate.target. User sessions are frozen, services stopped orderly via inhibitors.

CAVEATS

Fails without hibernation configured (swap, resume kernel param, initramfs). Delay customizable via HibernateDelaySec= in /etc/systemd/sleep.conf. Not all hardware supports reliable suspend-then-hibernate; test thoroughly. Drains battery faster than pure suspend.

CONFIGURATION

Set HibernateDelaySec=1800 (seconds) in /etc/systemd/sleep.conf. Enable via logind.conf: HandleSuspendKey=suspend-then-hibernate, HandleLidSwitch=suspend-then-hibernate. Reload with systemctl restart systemd-logind.

SETUP REQUIREMENTS

1. Create swap ≥ RAM.
2. mkinitcpio -P or update-initramfs -u with resume hook.
3. Add resume=UUID=SWAPUUID to kernel cmdline.
4. Test with systemctl hibernate first.

HISTORY

Introduced in systemd 197 (January 2013) alongside hybrid-sleep, enhancing power management. Evolved with systemd-logind integration for timeouts and triggers.

SEE ALSO

systemctl(1), systemctl suspend(1), systemctl hibernate(1), systemctl hybrid-sleep(1), systemd-sleep.conf(5), logind.conf(5)

Copied to clipboard