When and how to reboot safely
Topic: Servers linux
Summary
Schedule a reboot during a maintenance window; notify users, stop or drain services if needed, run reboot or shutdown -r, and verify the system and services after boot. Use this when applying kernel or critical updates, or recovering from a hung state.
Intent: How-to
Quick answer
- Notify users and schedule a window. Stop non-essential services or put load balancers in maintenance; optionally run needrestart -u to see what will be restarted after reboot.
- shutdown -r +5 'Reboot in 5 min' schedules reboot and broadcasts; cancel with shutdown -c. Or reboot now: sudo reboot. For delayed: shutdown -r 02:00.
- After boot, check systemctl list-units --state=failed; verify critical services and connectivity; check logs (journalctl -b) for errors.
Prerequisites
Steps
-
Plan and notify
Choose a maintenance window; notify users. List services that must be up (systemctl list-units --type=service --state=running); plan to stop or drain if needed (e.g. put app in read-only or drain LB).
-
Schedule or run reboot
sudo shutdown -r +10 'Reboot in 10 min' or sudo shutdown -r 03:00 for a time. Cancel with shutdown -c. For immediate: sudo reboot. Ensure you have console or out-of-band access in case of boot failure.
-
Verify after boot
Check systemctl list-units --state=failed; start any required services that did not come up; run journalctl -b for boot logs; verify app and network.
Summary
Plan a maintenance window, notify users, and stop or drain services as needed. Use shutdown or reboot to restart; after boot, check for failed units and verify services. Use this for kernel updates or planned recovery.
Prerequisites
Steps
Step 1: Plan and notify
Schedule a window and notify users. Identify critical services; plan to stop or drain them if appropriate.
Step 2: Schedule or run reboot
sudo shutdown -r +10 "Reboot in 10 min"
# or
sudo reboot
Cancel with shutdown -c if needed.
Step 3: Verify after boot
systemctl list-units --state=failed
journalctl -b
Start any required services and verify connectivity.
Verification
- Reboot completed; no unexpected failed units; critical services and apps are running.
Troubleshooting
Reboot hung — Use console or OOB; see How to troubleshoot boot failure. Service did not start — See Service won’t start.