On CentOS and RHEL, you can check if the system needs a full reboot by checking the kernel version and the kernel release.
A full reboot is required when the running kernel version and release are different from the latest installed kernel version and release.
You can check the running kernel version and release by running the command:
uname -r
This command will return the version and release of the currently running kernel, e.g. 5.4.0-42-generic
You can check the version and release of the latest installed kernel by running the command:
rpm -q kernel
This command will return the version and release of the latest installed kernel package, e.g. kernel-5.4.0-42.46.el8.x86_64
You can compare the output of these two commands to see if they match. If they do not match, then a full reboot is required to use the latest kernel.
It’s important to note that you may have multiple kernels installed on the system, and the above commands will only show the running and latest installed kernel. In this case, you can use the command “rpm -qa | grep kernel” to list all the kernels that are installed on the system.
Additionally, you can use the command “yum update –obsoletes” to check if there are packages that require a reboot of the system.
Please also note that a full reboot is also required when you update critical system components such as the kernel, glibc, etc. A reboot will ensure that the updated components are loaded and can function correctly, it’s important to plan a reboot in a maintenance window to minimize the impact on the services.