From c250c9042900d5ea12fdeaac0a05a78d6fc08b73 Mon Sep 17 00:00:00 2001 From: Markus Frosch Date: Fri, 11 Feb 2022 17:49:32 +0100 Subject: [PATCH] Fix docker detection on newer Kernels On Debian bullseye there will not always be a string after the first colon. Example: 0::/system.slice/docker-xxx.scope --- perl/lib/NeedRestart/CONT/docker.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/perl/lib/NeedRestart/CONT/docker.pm b/perl/lib/NeedRestart/CONT/docker.pm index 80fdfc45..4a225256 100644 --- a/perl/lib/NeedRestart/CONT/docker.pm +++ b/perl/lib/NeedRestart/CONT/docker.pm @@ -67,9 +67,9 @@ sub check { } # look for docker cgroups - return 0 unless($cg =~ /^\d+:[^:]+:\/system.slice\/docker-(.+)\.scope$/m || - $cg =~ /^\d+:[^:]+:\/system.slice\/docker\.service$/m || - $cg =~ /^\d+:[^:]+:\/docker\/([\da-f]+)$/m); + return 0 unless($cg =~ /^\d+:[^:]*:\/system.slice\/docker-(.+)\.scope$/m || + $cg =~ /^\d+:[^:]*:\/system.slice\/docker\.service$/m || + $cg =~ /^\d+:[^:]*:\/docker\/([\da-f]+)$/m); print STDERR "$LOGPREF #$pid is part of docker container '$1' and will be ignored\n" if($self->{debug});