Skip to content

Commit

Permalink
Merge pull request #238 from lathiat/fix-cgroupsv2
Browse files Browse the repository at this point in the history
Fix LXC/LXD and machined detection for cgroups v2
  • Loading branch information
liske committed Mar 16, 2022
2 parents 4e3c2b4 + 8465c3e commit eb3531a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion perl/lib/NeedRestart/CONT/LXC.pm
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ sub check {
}

# look for LXC cgroups
return unless($cg =~ /^\d+:[^:]+:\/lxc(?:.payload)?[.\/]([^\/\n]+)($|\/)/m);
return unless($cg =~ /^\d+:[^:]*:\/lxc(?:.payload)?[.\/]([^\/\n]+)($|\/)/m);

my $name = $1;
my $type = ($self->{has_lxd} && -d qq($self->{lxd_container_path}/$name) ? 'LXD' : 'LXC');
Expand Down
2 changes: 1 addition & 1 deletion perl/lib/NeedRestart/CONT/machined.pm
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ sub check {
}

# look for machined cgroups
return 0 unless($cg =~ /^\d+:[^:]+:\/machine.slice\/machine-(.+)\.scope$/m);
return 0 unless($cg =~ /^\d+:[^:]*:\/machine.slice\/machine-(.+)\.scope$/m);

my $name = $1;
unless($norestart) {
Expand Down

0 comments on commit eb3531a

Please sign in to comment.