liske / needrestart

Restart daemons after library updates.
GNU General Public License v2.0
426 stars 67 forks source link

Erroneously reporting containerd needs restarting #305

Closed mpounsett closed 2 months ago

mpounsett commented 4 months ago

After an upgrade of one of our container-based applications last night (NextCloud), needrestart is reporting that containerd needs restarting. Actually restarting containerd is having no effect.

Looking through the debug output I see containerd being detected, but the reason for the detection isn't clear to me.

needrestart 3.5-4+deb11u3 (Debian 11 package)

% sudo needrestart -b -vvvv
[main] eval /etc/needrestart/needrestart.conf
[main] needrestart v3.5
[main] running in root mode
[main] systemd detected
NEEDRESTART-VER: 3.5
[Core] #898 is a NeedRestart::Interp::Python
[Python] #898: source=/usr/share/unattended-upgrades/unattended-upgrade-shutdown
[Core] #899 is a NeedRestart::Interp::Perl
[Perl] #899: source=/usr/sbin/munin-node
[Core] #3407452 is a NeedRestart::Interp::Python
[Python] #3407452: process cwd is unreachable
[Core] #3407476 is a NeedRestart::Interp::Python
[Python] #3407476: process cwd is unreachable
[Core] #3407553 is a NeedRestart::Interp::Python
[Python] #3407553: process cwd is unreachable
[Core] #3407567 is a NeedRestart::Interp::Python
[Python] #3407567: process cwd is unreachable
[Core] #3408698 is a NeedRestart::Interp::Python
[Python] #3408698: could not get current working directory, skipping
[main] #3408822 uses deleted /memfd:vmem
[main] #3408822 is a child of #3407567
[main] #3413186 uses deleted /memfd:doublemapper
[main] #3413186 is a child of #3413059
[main] #3413190 uses deleted /memfd:doublemapper
[main] #3413190 is a child of #3413043
[main] #3413215 uses deleted /memfd:doublemapper
[main] #3413215 is a child of #3413054
[main] #3413224 uses deleted /memfd:doublemapper
[main] #3413224 is a child of #3413058
[main] #3413247 uses deleted /memfd:doublemapper
[main] #3413247 is a child of #3413047
[main] #3413284 uses deleted /memfd:doublemapper
[main] #3413284 is a child of #3413188
[main] #3413338 uses deleted /memfd:doublemapper
[main] #3413338 is a child of #3413234
[main] #3413668 uses deleted /memfd:doublemapper
[main] #3413668 is a child of #3413585
[main] #3413693 uses deleted /memfd:doublemapper
[main] #3413693 is a child of #3413583
[main] #3407567 exe => /usr/bin/python3.11
[Core] #3407567 is a NeedRestart::Interp::Python
[Python] #3407567: process cwd is unreachable
[Core] #3407567 source is UNKNOWN
[main] #3407567 unexpected cgroup '/system.slice/docker-02fa42687c6ed9db915afb0109e47cd06d2b89920d2f80da222132730f96b4f1.scope'
[main] trying systemctl status
[main] #3407567 running /etc/needrestart/hook.d/10-dpkg
dpkg-query: no path found matching pattern /usr/bin/python3.11
[main] #3407567 running /etc/needrestart/hook.d/20-rpm
[main] #3407567 running /etc/needrestart/hook.d/30-pacman
[main] #3407567 running /etc/needrestart/hook.d/90-none
[main] #3413043 exe => /usr/bin/containerd-shim-runc-v2
[main] #3413043 is containerd.service
[main] #3413047 exe => /usr/bin/containerd-shim-runc-v2
[main] #3413047 is containerd.service
[main] #3413054 exe => /usr/bin/containerd-shim-runc-v2
[main] #3413054 is containerd.service
[main] #3413058 exe => /usr/bin/containerd-shim-runc-v2
[main] #3413058 is containerd.service
[main] #3413059 exe => /usr/bin/containerd-shim-runc-v2
[main] #3413059 is containerd.service
[main] #3413188 exe => /usr/bin/containerd-shim-runc-v2
[main] #3413188 is containerd.service
[main] #3413234 exe => /usr/bin/containerd-shim-runc-v2
[main] #3413234 is containerd.service
[main] #3413583 exe => /usr/bin/containerd-shim-runc-v2
[main] #3413583 is containerd.service
[main] #3413585 exe => /usr/bin/containerd-shim-runc-v2
[main] #3413585 is containerd.service
[ucode] using NeedRestart::uCode::AMD
[ucode] using NeedRestart::uCode::Intel
[uCode/AMD] #0 cpu vendor id mismatch
[uCode/Intel] #0 current revision: 0x5003604
+ iucode_tool --scan-system
+ grep -oE [^[:space:]]+$
+ sig=0x00050657
+ [ -r /sys/devices/system/cpu/cpu0/microcode/processor_flags ]
+ cat /sys/devices/system/cpu/cpu0/microcode/processor_flags
+ filter=-s 0x00050657,0x80
+ test -r /etc/needrestart/iucode.sh
+ . /etc/needrestart/iucode.sh
+ type bsdtar
+ IUCODE_TOOL_EXTRA_OPTIONS=
+ test -r /etc/default/intel-microcode
+ . /etc/default/intel-microcode
+ test  = no
+ [ -r /usr/share/misc/intel-microcode* ]
+ iucode_tool -l -s 0x00050657,0x80 --ignore-broken -tb /lib/firmware/intel-ucode
+ grep 0x00050657
[uCode/Intel] #0 available revision: 0x5003604
[Kernel] Linux: kernel release 5.10.0-30-amd64, kernel version #1 SMP Debian 5.10.218-1 (2024-06-01)
Failed to load NeedRestart::Kernel::kFreeBSD: [Kernel/kFreeBSD] Not running on GNU/kFreeBSD!
[Kernel/Linux] /boot/vmlinuz-5.10.0-30-amd64 => 5.10.0-30-amd64 (debian-kernel@lists.debian.org) #1 SMP Debian 5.10.218-1 (2024-06-01) [5.10.0-30-amd64]*
[Kernel/Linux] /boot/vmlinuz-5.10.0-29-amd64 => 5.10.0-29-amd64 (debian-kernel@lists.debian.org) #1 SMP Debian 5.10.216-1 (2024-05-03) [5.10.0-29-amd64]
[Kernel/Linux] Expected linux version: 5.10.0-30-amd64
NEEDRESTART-KCUR: 5.10.0-30-amd64
NEEDRESTART-KEXP: 5.10.0-30-amd64
NEEDRESTART-KSTA: 1
NEEDRESTART-UCSTA: 1
NEEDRESTART-UCCUR: 0x5003604
NEEDRESTART-UCEXP: 0x5003604
NEEDRESTART-SVC: containerd.service
liske commented 2 months ago

This is related to #235: needrestart 3.5 was missing cgroup v2 support.