Perform late-night maintenance safely by scheduling shutdowns, notifying users, canceling pending power events, and executing clean reboots. Practice the modern and legacy command paths that you still see in real environments.
You are performing late-night maintenance on a production server. Updates have been applied, users are still logged in, and you must schedule a shutdown window, cancel it when required, then reboot cleanly. You also need to understand legacy runlevel reboot behavior and the difference between halting and powering off.
Production maintenance is about clear communication and predictable system state changes. The goal is to minimize surprises: warn users, verify intent, and use the least disruptive command that accomplishes the operation.
init
.
shutdown
.
shutdown -c
.
reboot
.
init 6
.
halt
and
shutdown -P
.
sudo shutdown +15
This schedules a shutdown in 15 minutes and broadcasts a warning to logged-in users. In real maintenance windows, you pair this with a clear change notice so people can save work and exit cleanly.
Broadcast message from root@lpic-lab47 (pts/0) (Tue Jul 22 01:15):
The system is going down for maintenance in 15 minutes!
Shutdown scheduled for Tue 2025-07-22 01:15:00 UTC; use 'shutdown -c' to cancel.
sudo shutdown -c
Requirements change. This cancels the pending shutdown and notifies users. If you schedule by mistake, cancel immediately to avoid accidental downtime.
Broadcast message from root@lpic-lab47 (pts/0) (Tue Jul 22 01:04):
Shutdown cancelled.
Planned shutdown has been cancelled.
sudo reboot
This triggers a clean reboot sequence. The system will broadcast a reboot notice and begin shutting down services. Use this after patching when you need a kernel or service restart that cannot be done safely in-place.
Broadcast message from root@lpic-lab47 (pts/0):
The system is going down for reboot NOW!
sudo init 6
You still see this in legacy documentation and older admin habits. Runlevel 6 traditionally maps to reboot. On systemd systems, this typically transitions into the equivalent reboot target behavior.
init: Switching to runlevel: 6
Rebooting...
sudo halt
Halting stops the system. Depending on configuration and platform, it may not cut power. Treat this as an emergency-style operation and understand what your environment does.
The system is going down NOW!
System halted.
sudo shutdown -P +1
This schedules a shutdown with power-off intent. The warning gives users a final moment to stop work, and the system will proceed to stop services and power down the host.
Broadcast message from root@lpic-lab47 (pts/0) (Tue Jul 22 01:16):
The system will power off in 1 minute!
Shutdown scheduled for Tue 2025-07-22 01:17:00 UTC; use 'shutdown -c' to cancel.
shutdown +<minutes>
: Schedules a shutdown and broadcasts a warning to users.
shutdown -c
: Cancels a scheduled shutdown (also broadcasts cancellation).
reboot
: Reboots the system using a clean shutdown/restart sequence.
init 6
: Legacy runlevel-based reboot command (runlevel 6 historically means reboot).
halt
: Stops the system; power-off behavior may vary by configuration/platform.
shutdown -P +1
: Schedules a shutdown with power-off intent after a delay.
-P
: Requests power-off after shutdown.