Incorrectly identifies processes inside LXD container on jammy/cgroupsv2

Bug #1964445 reported by Trent Lloyd
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
needrestart (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Processes inside of LXD containers are incorrectly identified as needing a restart on jammy. The cause is that needrestart does not correctly parse cgroups v2.

Since needrestart is installed in a default install, this is problematic as it prompts you to restart and actually restarts the host version of a container's processes unnecessarily.

I have sent an upstream pull request to fix this here, it's a simple fix to the regex:
https://github.com/liske/needrestart/pull/238

Upstream also already has a fix to the same for Docker:
https://github.com/liske/needrestart/pull/234

We should patch both of these into Jammy before release. I can send this patch upstream to Debian also however as they do not currently use cgroups v2 by default it is not directly affected in a default configuration (but would be affected if you enable them). Since we are also close to release this may also need to be expedited.

= Test Case =

- Install Jammy Server with needrestart installed (the server iso installs it by default, cloud/vm/lxd images do not)
- Launch an LXD focal container
- (slightly harder) inside the focal container, upgrade a commonly used library such as libc6. To do this you may need to first downgrade libc6, restart avahi-daemon, upgrade it again.
- Run "needrestart" on the host and see that the container's avahi-daemon is recognised to restart (but it will restart the hosts process, and the next invocation will prompt to restart again)

Related branches

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Hi Trent, FYI I've seen this and want to drive an FFe for this any many more fixes into Jammy in bug 1965090

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :
Changed in needrestart (Ubuntu):
status: New → In Progress
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package needrestart - 3.5-5ubuntu2

---------------
needrestart (3.5-5ubuntu2) jammy; urgency=medium

  * d/p/Jammy-update-to-git*: Update needrestart from git (LP: #1965090)
    - fixes handling with cgroupv2 for docker and lxd (LP: #1964445)
    - adds detection of qemu VMs using outdated libs
    - various minor fixes

 -- Christian Ehrhardt <email address hidden> Wed, 16 Mar 2022 08:53:23 +0100

Changed in needrestart (Ubuntu):
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.