Patching
Kernel updates need a reboot: finding servers running old kernels
Installing a kernel update doesn't protect you until the server restarts. How to tell which servers are running an older kernel than the one installed.
Your servers install security updates automatically, including kernel updates. But a new kernel sitting on disk doesn't protect anything. Until the server restarts, it keeps running the old kernel, with every vulnerability the update was meant to fix.
Why the kernel is different
Most package updates take effect as soon as the affected service restarts. The kernel is the one piece of software that's loaded at boot and stays in memory until the next boot. Installing linux-image-* puts the new kernel in /boot and updates the bootloader, then waits.
Servers that rarely restart can end up several kernel builds behind, sometimes for months, while dashboards show “all security updates installed”.
How to tell if a server needs a reboot
Ubuntu and Debian leave a marker file when an update needs a reboot:
$ cat /var/run/reboot-required
*** System restart required ***
$ cat /var/run/reboot-required.pkgs
linux-image-5.15.0-125-generic
linux-base
To compare the running kernel with what's installed:
$ uname -r
5.15.0-119-generic
$ dpkg -l 'linux-image-[0-9]*' | awk '/^ii/{print $2}'
linux-image-5.15.0-119-generic
linux-image-5.15.0-125-generic
Here the server runs 119 while 125 is installed: a few builds behind, with whatever fixes landed in between still not active.
Your options
- Schedule reboots. The simplest fix. Pick a maintenance window, drain traffic if you have more than one server, and reboot. Uptavio's maintenance windows silence alerts while you do.
- Automatic reboots. unattended-upgrades can reboot on its own with
Unattended-Upgrade::Automatic-Reboot "true";and a time set inAutomatic-Reboot-Time. Fine for redundant servers; risky for single ones. - Livepatch. Canonical Livepatch (part of Ubuntu Pro) applies critical kernel fixes without a reboot. It reduces urgency, but you still need periodic reboots to move to new kernel builds.
The fleet problem
On one server, checking /var/run/reboot-required is easy. On thirty, spread across clients and providers, nobody checks until something goes wrong. The useful question is a fleet-wide one: which servers are running an older kernel than they have installed, by how much, and since when?
How Uptavio handles it
Uptavio checks every hour whether a reboot is required. A “Reboot pending” badge on each server shows how many kernel builds behind it's running. Because the fix is the same everywhere, the To do list groups it into a single task, “Reboot to load installed updates”, with every affected server listed and sudo reboot ready to copy. The task closes itself once each server comes back on the new kernel.
A pending reboot also counts against the server's patching score, so it shows up in the health grade and the monthly report, not only in a log file.
The takeaway
Installing kernel updates is half the job. Track which servers are running an older kernel than they have installed, and make reboots a routine, planned part of patching instead of something that happens by accident.
Uptavio checks this for you. Ubuntu-aware vulnerability scanning, outside-in exposure checks, patch and reboot tracking, and a To do list with the exact command for every fix. Free for 2 servers and 5 websites. Start free →