Introduction
WHM presents the following banner that doesn't seem to be cleared upon reboot:
This issue occurs when the kernel has recently been updated, but the server's package manager still indicates it requires a reboot. The most common reasons are that the system time is outdated or the currently running kernel is not the latest installed. The following procedure will show you how to verify both of these possibilities.
Procedure
Please note that the following instructions are provided as a guide. If there are any discrepancies with your system time or kernel, or your server otherwise consistently asks you to reboot, it should be reviewed by a qualified System Administrator familiar with the server's needs.
- Access the server through SSH as the root user.
- Use the following WHMAPI command to determine if your system requires a reboot. If it does, it will return a list of recently updated packages and the kernel version if it has been updated, resembling the following:
[root@server ~]# whmapi1 system_needs_reboot
---
data:
details:
kernel:
boot_version: 4.18.0-513.9.1.el8_9.x86_64
running_version: 4.18.0-477.21.1.el8_8.x86_64
updates:
dbus: 1
dbus-daemon: 1
glibc: 1
linux-firmware: 1
systemd: 1
needs_reboot: 1
metadata:
command: system_needs_reboot
reason: OK
result: 1
version: 1 - If your system only lists outdated packages and not a kernel, the server time may not be in sync. You can run the following command to see the server's current time:
date
- The following command will search the dnf update logs for the timestamp of when a package was updated. Using one of the package names from the system_needs_reboot output, perform a search:
grep $package /var/log/dnf.log
- If the timestamp in the log is after the timestamp provided by the date command, then your system time is out of sync and will need to be updated.
- Use the following command to verify the currently running kernel:
[root@server ~]# uname -r
4.18.0-477.21.1.el8_8.x86_64 - This command will show you the currently selected entry in the grub configuration:
[root@server ~]# grub2-editenv list
saved_entry=45364634272e4a2785ef4021c6d32bd8-4.18.0-513.11.1.el8_9.x86_64
kernelopts=root=UUID=4c90d825-f649-4c1b-97b8-11f283331ef5 ro console=tty0 console=ttyS0,115200 earlyprintk=ttyS0,115200 consoleblank=0 crashkernel=no nosplash net.ifnames=0 nomodeset rootflags=uquota
boot_success=0
boot_indeterminate=0 - If there is a mismatch between the version number of these entries, here listed as 4.18.0-477.21.1 and 4.18.0-513.11.1, then the server is not booted into it's most recent kernel.
- Create a backup of your current grub configuration:
cp -vi /boot/grub2/grub.cfg{,.bak}
- Use the following command to set the default boot kernel to the first entry in the grub configuration, which is usually the most current kernel. Please note that this can differ between server configurations. If you are unsure of the configuration you should check with your System Administrator:
grub2-set-default 0
- Rebuild the grub configuration to commit the changes:
sudo grub2-mkconfig -o /boot/grub2/grub.cfg
- Reboot the server.
Additional Information
The following resource can show you how to install and set up NTP to automatically sync your server time whenever it restarts:
Use NTP to Sync Time
Comments
0 comments
Article is closed for comments.