Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

yum Script shows "reboot required" after updating and reboot #44

Open
47k opened this issue Aug 4, 2021 · 15 comments
Open

yum Script shows "reboot required" after updating and reboot #44

47k opened this issue Aug 4, 2021 · 15 comments

Comments

@47k
Copy link

47k commented Aug 4, 2021

yum Script shows "reboot required" after updating and reboot

@HenriWahl
Copy link
Owner

Sometimes the local YUM cache still tells it needs reboot - cleaning it could help.

@47k
Copy link
Author

47k commented Aug 12, 2021

It's usually. I installed today a new server (XCP-ng) and I got the message with 34 updates and after that (after rebooting) the reboot required message.

The old Nagios plugin I used before with MRPE is working fine with no reboot message.

@47k
Copy link
Author

47k commented Aug 13, 2021

Today I installed the newest version (2.3.3). I checked for updates (no updates) and I restarted the server - but after the restart, the "reboot required" is still shown in CheckMK

@HenriWahl
Copy link
Owner

In issue #45 there seems to be a hint that the bakery function of the yum plugin does not work correctly - what about your agent on the client host? Does it have the needed yum plugin locally?

@47k
Copy link
Author

47k commented Aug 23, 2021

I don't use the bakery for that systems. I installed the newest client manually (2.0.0p9) and the plugin is under "/usr/lib/check_mk_agent/plugins".

Today I got this from two of my machines:

  • All packages are up to date, -1 Time of last update could not be found, reboot required CRIT
  • All packages are up to date, Last Update was too long ago at 2021-04-04 12:24:00 but there are no pending updates, reboot required CRIT

@HenriWahl
Copy link
Owner

What is the output of cmk -d <host> regarding the host you have that problem with?

@47k
Copy link
Author

47k commented Aug 25, 2021

All packages are up to date, Last Update was too long ago at 2021-04-04 12:24:00 but there are no pending updates, reboot required CRIT
<<>>
yes
0
0
1612475160

All packages are up to date, -1 Time of last update could not be found, reboot required CRIT
<<>>
yes
0

All packages are up to date, Last Update was run at 2021-08-05 8:57:00, reboot required CRIT
<<>>
yes
0
0
1628499420

The plugin is running on that issue on all of my servers - and I have the same issue with the testing server I installed. And the issue still occurs after reboot:

After Start, Reboot and before Updates: All packages are up to date, Last Update was run at 2021-08-04 13:18:00, reboot required CRIT
<<>>
yes
0
0
1628075880

Looking for updates and there where no updates: All packages are up to date, Last Update was run at 2021-08-04 13:18:00, reboot required CRIT
<<>>
yes
0
0
1628075880

Did an restart but still the same: All packages are up to date, Last Update was run at 2021-08-04 13:18:00, reboot required CRIT
<<>>
yes
0
0
1628075880

@47k
Copy link
Author

47k commented Sep 23, 2021

Anything we can do here?

@HenriWahl
Copy link
Owner

Honestly I do not know because I can't reproduce this behaviour.

@47k
Copy link
Author

47k commented Sep 24, 2021

You can test it simply by installing xen-ng in virtual machine and add the plugin - that's it.

But maybe, do you have something configured under "YUM Update check"? There you can control:

  • State when a reboot is required
  • State when normal updates are available
  • State when security updates are available
  • Max Time since last last run update (Default 60 Days)
  • Change State based on last run update (default OK)

I did nothing - but there is a possibility to change the reboot required state. Maybe it's on "Ok" on you side. Sure I can change it as well, but then there is no warning when a reboot is needed.

@sqoerk-dev
Copy link

sqoerk-dev commented Oct 25, 2021

We have the same error on CentOS 7 and RedHat 8. Cache clean helps on some systems. Some still say reboot needed.

Okay checked the check rutine for "reboot requered". If the running kernel is not the same as the latest kernel, reboot is always requierd:

[root@server]# echo $LATEST_KERNEL
5.14.0-1.el7.elrepo
[root@server]# echo $RUNNING_KERNEL
4.18.0-305.19.1.el8_4

@47k
Copy link
Author

47k commented Dec 22, 2021

Issue still perist - some days ago I restarted three of my machines and this is the output after the restart:
-All packages are up to date, -1 Time of last update could not be found, reboot required
-All packages are up to date, Last Update was too long ago at 2021-02-04 22:46:00 but there are no pending updates, reboot required
-All packages are up to date, Last Update was run at 2021-08-09 10:57:00, reboot required

The date with the last update is wrong as well. I updated and restarted the server 6 days ago.

@LordKackroellchen
Copy link

Hey guys

Same problem at our xcp-ng installations.

I have try and test a simple workarround for the xcp-ng installation. I change the kernel request to a simple yum-tool called needs-restarting. Maybe you have to install it, package is yum-utils.

#    LATEST_KERNEL=$(yum -q -C --noplugins --debuglevel 0 list installed | egrep "^(vz)?kernel(|-(uek|ml|lt))\." | grep "\." | tail -n1 | awk '{print $2};')
#    RUNNING_KERNEL=$(cat /proc/version | awk '{print $3}' | sed 's/.x86_64//g')
#    if [[ "$RUNNING_KERNEL" == "$LATEST_KERNEL"* ]]

REBOOTREQUIRED=$(needs-restarting ; echo $?)
  if [ "$REBOOTREQUIRED" = "0" ]
   then
        BOOT_REQUIRED="no"
    else
        BOOT_REQUIRED="yes"
    fi

This workarround is simple and work 4 us.

@swampdogmash
Copy link
Contributor

swampdogmash commented Nov 14, 2024

Is this still an issue? Are you using kexec when you update kernel to avoid downtime? I wonder if you reported running kernel versions and "on disk" versions don't match up for some reason - although this wouldn't necessarily make sense if you are rebooting and still getting the same message even after the reboot.

Can I ask if one of you could get the output from:

yum -q -C --noplugins --debuglevel 0 list installed | egrep "^(vz)?kernel(|-(uek|ml|lt))\."

then

yum -q -C --noplugins --debuglevel 0 list installed | egrep "^(vz)?kernel(|-(uek|ml|lt))\." | grep "\." | tail -n1 | awk '{print $2};'

followed by

cat /proc/version | awk '{print $3}' | sed 's/.x86_64//g'

and

ls -al /boot

So that we can see what might be being detected? I'm wondering if the sort order on the first command is different on your systems and thus the kernel version reported by what yum thinks is installed is not getting the "latest" and thus the comparison to the running version is different.

@swampdogmash
Copy link
Contributor

swampdogmash commented Nov 14, 2024

Hey guys

Same problem at our xcp-ng installations.

I have try and test a simple workarround for the xcp-ng installation. I change the kernel request to a simple yum-tool called needs-restarting. Maybe you have to install it, package is yum-utils.

#    LATEST_KERNEL=$(yum -q -C --noplugins --debuglevel 0 list installed | egrep "^(vz)?kernel(|-(uek|ml|lt))\." | grep "\." | tail -n1 | awk '{print $2};')
#    RUNNING_KERNEL=$(cat /proc/version | awk '{print $3}' | sed 's/.x86_64//g')
#    if [[ "$RUNNING_KERNEL" == "$LATEST_KERNEL"* ]]

REBOOTREQUIRED=$(needs-restarting ; echo $?)
  if [ "$REBOOTREQUIRED" = "0" ]
   then
        BOOT_REQUIRED="no"
    else
        BOOT_REQUIRED="yes"
    fi

This workarround is simple and work 4 us.

Thanks for the workaround. I think needs-restarting might cause an issue with timeouts on a lot of systems particularly ones with many processes or lots of memory. See note in #67 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants