Technical

needrestart false positive: why it triggers on Proxmox and in LXC containers

needrestart false positive: why it triggers on Proxmox and in LXC containers

needrestart false positive on Proxmox is almost always the container seeing the host’s /proc or a stale libssl map. It’s not a real restart requirement — the tool just can’t tell the difference. Here’s the config that shuts it up.

Artistic arrangement of circuit boards and cables symbolizes modern technology.

Why it misfires inside LXC

needrestart checks /proc to decide what’s running. In an unprivileged LXC, /proc is the host’s /proc. So the container sees the host’s kernel, the host’s processes, and the host’s package state. It thinks the host’s libssl is the container’s libssl. Then it flags every service that links against it.

The other trigger is deleted-library mapping. After a libssl upgrade, the old .so is gone but the process still has it mapped. needrestart sees the deleted inode and assumes the service is using a removed library. That’s a false positive too — the process is fine, it just hasn’t been restarted since the upgrade. On a Proxmox host this happens after apt upgrades. In a container it happens after the host upgrades and the container’s package list is stale.

Close-up of glowing fiber optic lights with a purple and blue bokeh effect.

The fix: override_rc and blacklist

needrestart 3.0+ uses /etc/needrestart/conf.d/override_rc.conf. The old $nrconf{override_rc} syntax still works but the new format is cleaner. This is what I use on the Proxmox host and in each LXC:

# /etc/needrestart/conf.d/override_rc.conf
$nrconf{override_rc}{qr(^postfix$)} = 0;
$nrconf{override_rc}{qr(^sshd$)} = 0;
$nrconf{blacklist}{qr(^libssl\.so)} = 1;

override_rc tells needrestart to skip the restart check for those services. The blacklist entry ignores the deleted libssl mapping entirely. That kills both false positive sources in one file.

For a container, you can go further: tell needrestart to not even look at the host’s /proc. Add this to the same file:

$nrconf{scan_procs} = 0;

That disables process scanning altogether. The container won’t see the host’s processes, so it won’t flag anything based on them. You lose the ability to detect a real restart need inside the container, but in a homelab LXC you’re usually restarting the whole container on upgrades anyway.

What I’d do

Put the override_rc and blacklist lines on the Proxmox host. Put the same plus scan_procs=0 in every LXC. It’s one file, copy it around. Then needrestart stops being a pain in the butt after every apt upgrade.

If you’re setting up a new Proxmox box, check the default EFI storage while you’re at it — that’s another thing that bites later if you don’t set it early.

And if you’re tired of needrestart entirely, just uninstall it. It’s not required for Proxmox to work. apt will still upgrade fine without it.

Leave a comment

Comments are reviewed before they appear. Your email is never published.