Rebooting a system
To prevent unplanned downtime, it's crucial to take specific precautions before initiating a reboot. The method followed to reboot a system can significantly impact whether the process is successful.
Practice
Considerations before rebooting a system.
0. Check if a reboot is required
Install the dnf-utils package, which provides the needs-restarting command.
After updating the system packages, run the needs-restarting -r command to see if a restart is required.
1. Active Users
Minimise disruption for logged in users by notifying them about the reboot.
- Use the who or w commands to see a list of logged-in users.
- Send a message to all logged in users, warning them of the impending reboot.
2. Open Files
Confirm that all important files have been saved and that no processes are writing data to the disk. - Force all data in the buffer to be written to the disk.
3. Mounted filesystems
Mount failures at boot time can prevent the system from fully booting up. Check that all mounts can be mounted successfully before rebooting the system.
- List all currently mounted filesystems.
- Verify that all mounts in
/etc/fstabcan be mounted successfully.
4. Scheduled jobs
Rebooting in the middle of a backup or maintenance job can result in an incomplete state. Check the scheduling of jobs and schedule the reboot accordingly.
- List currently scheduled jobs.
5. Checking Filesystems
Rebooting with a full /var filesystem has historically caused problems with servers coming back up. Check your filesystem space and act accordingly.
- Check filesystem usage
- Depending on your environment, there could be additional filesytems that could hinder reboot. To check the rest of the filesytems.
- If the list from the standard
df -his unmanagable to look through due to extratmpfs, overlay, shm, snap filesystems. They can be excluded with the below