How to Delay a Reboot in Linux

Deepak Prasad
Tested on RHEL 10.2 (Coughlan) — vm1.lab.example
Package systemd 257-23.el10_2.2
at 3.2.5-14.el10_1
Applies to RHEL, Rocky Linux, AlmaLinux, Fedora, Ubuntu, Debian, and other Linux hosts using systemd as PID 1
Privilege sudo or root to schedule, inspect, and cancel reboots
Scope Schedule a delayed reboot, notify users, inspect the pending job, cancel it, and send a dry-run warning with -k. Covers shutdown, systemctl reboot --when=, and a short at example. Does not cover immediate reboot, poweroff, halt, or full shutdown command reference — see the linked boot and shutdown guide.
Related guides Boot, reboot and shutdown
at command
systemctl command
crontab command
Run script before shutdown

A delayed reboot is useful when an update requires a restart but you need to wait for a maintenance window or give logged-in users time to finish work. If you are delaying a reboot after package updates, confirm first whether one is actually required. On systemd hosts you schedule the event instead of running reboot immediately, and you keep a cancel path if the window moves.

For immediate power actions and a full command reference, see Boot, Reboot and Shut Down Linux with systemd.


Quick answer

Goal Command
Reboot in N minutes sudo shutdown -r +15 "maintenance in 15 minutes"
Reboot at a clock time sudo shutdown -r 22:30 "nightly patch window"
Show pending job sudo shutdown --show
Cancel pending job sudo shutdown -c
Schedule with systemctl sudo systemctl reboot --when="+15min"
Cancel systemctl schedule sudo systemctl reboot --when=cancel
Warn only (no reboot) sudo shutdown -k +10 "drill message"
One-off at a fixed time echo "shutdown -r now" | at 02:00 (see at command)

Leave a space between the time argument and the wall message. shutdown -r +5"message" fails to parse on current systemd releases.


Schedule a delayed reboot with shutdown

The shutdown command is the traditional front end for timed power events. On RHEL 10 it is a compatibility wrapper around systemctl, but the +MINUTES and HH:MM syntax is still what most runbooks use.

Schedule a reboot five minutes ahead and attach a wall message:

bash
sudo shutdown -r +5 "GLC maintenance test"

Sample output:

output
Reboot scheduled for Fri 2026-08-21 14:32:15 IST, use 'shutdown -c' to cancel.

The scheduler line confirms the absolute deadline. Logged-in TTY and SSH sessions also receive broadcast traffic as the window closes; five minutes before shutdown, /run/nologin blocks new logins (see Boot, Reboot and Shut Down Linux with systemd for that timeline).

Other common time forms:

  • +15 — fifteen minutes from now
  • 22:30 — 22:30 today, or tomorrow if that time already passed
  • now — immediate reboot (same as shutdown -r now)

If you omit the message, systemd still schedules the job; add a short quoted string so users know why the host is going down.


Check or cancel the scheduled reboot

After scheduling, read the queue before you walk away:

bash
sudo shutdown --show

Sample output while a job is active:

output
Reboot scheduled for Fri 2026-08-21 14:32:15 IST, use 'shutdown -c' to cancel.

If plans change, cancel the job:

bash
sudo shutdown -c

shutdown -c exits silently on success. Verify the queue is empty:

bash
sudo shutdown --show

Sample output:

output
No scheduled shutdown.

On the tested RHEL 10.2 system, shutdown --show returned exit status 1 when no shutdown was scheduled. That non-zero exit did not mean the cancel failed—the line above is what confirms the queue is idle.

Tell users the maintenance window was called off. A cancelled job stops the reboot, but earlier wall messages may still be visible in their sessions.


Warn users without rebooting

Maintenance drills and communication tests sometimes need the wall traffic without powering off. The -k flag schedules warnings only:

bash
sudo shutdown -k +3 "drill only — no reboot"

Sample output:

output
Shutdown scheduled for Fri 2026-08-21 14:30:20 IST, use 'shutdown -c' to cancel.

Despite the word “Shutdown” in the line, -k does not enqueue halt, poweroff, or reboot. Cancel the drill the same way as a real job:

bash
sudo shutdown -c

Use -k to validate messaging paths; use -r +N when the host should actually restart.


Schedule a reboot with systemctl --when

systemd 254 and later expose the same scheduling through explicit verbs. This spelling fits scripts that already call systemctl for units:

bash
sudo systemctl reboot --when="+10min"

Sample output:

output
Reboot scheduled for Fri 2026-08-21 14:37:20 IST, use 'systemctl reboot --when=cancel' to cancel.

Inspect the shared shutdown queue:

bash
sudo systemctl reboot --when=show

Sample output:

output
Reboot scheduled for Fri 2026-08-21 14:37:20 IST, use 'systemctl reboot --when=cancel' to cancel.

Cancel before the timer fires:

bash
sudo systemctl reboot --when=cancel

The cancel command exits silently. Confirm nothing remains:

bash
sudo systemctl reboot --when=show

Sample output:

output
No scheduled shutdown.

ISO-style durations such as +15min work here; shutdown remains better when you need HH:MM wall-clock times or the classic +MINUTES form. The boot and shutdown guide walks through both interfaces side by side.


Schedule a one-off reboot with at

Use at only when you specifically want the reboot managed as an at job or are already using the at queue. For normal delayed reboots, shutdown -r HH:MM or systemctl reboot --when= is simpler. The example below queues shutdown -r now for 02:00; when that time has already passed today, at schedules the job for the next day:

bash
echo "shutdown -r now" | at 02:00

Sample output:

output
warning: commands will be executed using /bin/sh
job 40 at Sat Aug 22 02:00:00 2026

List pending jobs before the window:

bash
atq

Sample output:

output
40	Sat Aug 22 02:00:00 2026 a root

Remove the job if the maintenance slips:

bash
sudo atrm 40

Replace 40 with the job number from atq. An at job runs the command at the chosen time without systemd wall traffic or /run/nologin unless you wrap it in shutdown yourself.


Troubleshooting

Symptom Likely cause Fix
Failed to parse time specification: +5message Missing space before the wall message Use shutdown -r +5 "message" — space before the opening quote
shutdown --show exits non-zero while idle Tested RHEL 10.2 returned exit 1 with No scheduled shutdown; other distros may differ Read the printed line; do not treat a non-zero exit alone as a failed cancel
Users cannot log in before the reboot /run/nologin appears five minutes before shutdown Finish work or cancel with shutdown -c; see the boot guide for the timeline
at: command not found at package not installed Install at and enable atd, or use shutdown / systemctl --when=
Scheduled reboot never cancelled but did not run Job removed by another admin or different interface Check shutdown --show and systemctl reboot --when=show; only one shutdown queue exists
Confusion after editing DefaultTimeoutStopSec Stop timeout controls service stop time after shutdown begins, not a scheduled delay Schedule with +N or --when= instead

References


Summary

Delaying a reboot is how you align maintenance with a countdown instead of dropping active sessions the moment an update finishes. The practical path is shutdown -r +MINUTES with a wall message, then shutdown --show to read the deadline and shutdown -c if the window moves.

systemd adds systemctl reboot --when="+15min" for the same queue when your scripts already speak systemctl. Use shutdown -k when you only need to test messaging, and reserve at only when you want the reboot on the at queue—not for ordinary delayed reboots. DefaultTimeoutStopSec is unrelated: it governs how long systemd waits for services to stop after shutdown begins, not how far ahead you can schedule a reboot.


Frequently Asked Questions

1. How do I schedule a reboot in 15 minutes on Linux?

Run sudo shutdown -r +15 "maintenance message" or sudo systemctl reboot --when="+15min". Both queue a reboot and broadcast a warning to logged-in users. Use shutdown --show or systemctl reboot --when=show to read the deadline.

2. How do I cancel a scheduled reboot?

Run sudo shutdown -c for a shutdown-scheduled job, or sudo systemctl reboot --when=cancel for a systemctl job. Confirm with shutdown --show or systemctl reboot --when=show; both should report no pending shutdown.

3. Does DefaultTimeoutStopSec delay a reboot?

No. DefaultTimeoutStopSec controls how long systemd waits for services to stop after shutdown begins; it does not schedule the reboot for later. Use shutdown -r +N or systemctl reboot --when= for a delayed reboot.

4. Should I use at or shutdown to reboot later?

Prefer shutdown or systemctl reboot --when= for normal delayed reboots because they integrate with systemd shutdown scheduling, wall messages, and /run/nologin five minutes before the event. Use at only when you specifically want the reboot managed as an at job or are already using the at queue.

5. Why does shutdown --show exit with status 1?

On the RHEL 10.2 system used for this guide, shutdown --show returned exit status 1 when no shutdown was scheduled and printed No scheduled shutdown. Exit status 0 meant a job was queued. Other distributions may treat the idle case differently; read the printed message, not only the exit code.
Omer Cakmak

Linux Administrator

Highly skilled at managing Debian, Ubuntu, CentOS, Oracle Linux, and Red Hat servers. Proficient in bash scripting, Ansible, and AWX central server management, he handles server operations on OpenStack, KVM, Proxmox, and VMware.

  • Debian
  • Ubuntu
  • Linux
  • Red Hat Enterprise Linux
  • Shell Script
  • System Administration