You must reboot the server to apply kernel updates warning not dismissing after reboot

Kent Brockman

Well-Known Member
Jan 20, 2008
1,222
39
178
Buenos Aires, Argentina
cPanel Access Level
Root Administrator
Hello everybody.

I'm seing this issue happenning on several VPS servers. No matter if you do a Graceful Reboot or enter "reboot" command via console, the warning "You must reboot the server to apply kernel updates." won't dissappear.

Common elements to those servers?
cPanel version = 82
Current Tier = RELEASE
OS = CENTOS 7.6 kvm
CloudLinux = not installed

needs-restarting command via console returns nothing, so the warning should not appear, right?

Code:
# needs-restarting
#
This behaviour started after cPanel v82
What may be failing to dismiss this warning?

Thanks in advance.
 

quietFinn

Well-Known Member
Feb 4, 2006
1,143
57
178
Finland
cPanel Access Level
Root Administrator
You could try to run:

Code:
yum update --assumeno
in command line.
 

Kent Brockman

Well-Known Member
Jan 20, 2008
1,222
39
178
Buenos Aires, Argentina
cPanel Access Level
Root Administrator
Yep. I did:

Code:
# yum update --assumeno
Loaded plugins: fastestmirror, universal-hooks
Loading mirror speeds from cached hostfile
 * EA4: 72.29.88.74
 * cpanel-addons-production-feed: 72.29.88.74
 * cpanel-plugins: 72.29.88.74
 * base: mirror.hackingand.coffee
 * centosplus: mirror.hackingand.coffee
 * extras: mirror.hackingand.coffee
 * updates: mirror.hackingand.coffee
No packages marked for update
 

Kent Brockman

Well-Known Member
Jan 20, 2008
1,222
39
178
Buenos Aires, Argentina
cPanel Access Level
Root Administrator
Yes, here we are:

Code:
[root]# whmapi1 system_needs_reboot
---
data:
  details:
    kernel:
      boot_version: 0-rescue-287a0145183844888c4a7fe5f823fe33
      running_version: 3.10.0-957.27.2.el7.centos.plus.bug16242.x86_64
  needs_reboot: 1
metadata:
  command: system_needs_reboot
  reason: OK
  result: 1
  version: 1

[root]# rpm -qa |grep kernel

kernel-plus-headers-3.10.0-957.27.2.el7.centos.plus.bug16242.x86_64
kernel-plus-3.10.0-514.21.1.el7.centos.plus.x86_64
kernel-plus-3.10.0-327.36.3.el7.centos.plus.x86_64
kernel-plus-3.10.0-514.16.1.el7.centos.plus.x86_64
kernel-plus-devel-3.10.0-957.27.2.el7.centos.plus.bug16242.x86_64
kernel-plus-tools-3.10.0-957.27.2.el7.centos.plus.bug16242.x86_64
kernel-plus-tools-libs-3.10.0-957.27.2.el7.centos.plus.bug16242.x86_64
kernel-plus-3.10.0-862.11.6.el7.centos.plus.x86_64
kernel-plus-3.10.0-957.27.2.el7.centos.plus.bug16242.x86_64

[root]# uname -r
3.10.0-957.27.2.el7.centos.plus.bug16242.x86_64
 

cPanelLauren

Forums Analyst II
Staff member
Nov 14, 2017
8,849
741
263
Houston
cPanel Access Level
DataCenter Provider
Thanks for that! It looks like the expected boot version in this instance is the rescue not the kernel version you're running which is the most up to date CentOS Plus kernel.

You should be able to get the boot order by running something like the following:

Code:
awk '/menuentry/ && /class/ {count++; print count-1"****"$0 }' /boot/grub2/grub.cfg
You might want to double-check also that grub.cfg is the name of the file in /boot/grub2/ if it returns an error telling you the file doesn't exist.

The boot order starts at 0. So for example this is what I have:

Code:
[[email protected] ~]# awk '/menuentry/ && /class/ {count++; print count-1"****"$0 }' /boot/grub2/grub.cfg
0****menuentry 'CentOS Linux (3.10.0-957.10.1.el7.x86_64) 7 (Core)' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-3.10.0-957.10.1.el7.x86_64-advanced-5f1b3a60-8f2a-46fa-9a04-62bb62de9338' {
1****menuentry 'CentOS Linux (0-rescue-d416c1d56b51458db7bdf98185b746dc) 7 (Core)' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-0-rescue-d416c1d56b51458db7bdf98185b746dc-advanced-5f1b3a60-8f2a-46fa-9a04-62bb62de9338' {

With that I can see that 0 is the kernel I want to use, so to change this I can run something like:

Code:
grub2-set-default 0
Changes like these are highly sensitive and if you are at all unsure of how to make these modifications I would strongly urge you to reach out to your provider or system administrator. If you do not have a qualified system administrator you might find one here: System Administration Services.

Thanks!