* [pve-devel] [PATCH v2 manager] pve7to8: Improve systemd unified cgroupv2 support check
@ 2023-06-12 10:31 Christian Ebner
2023-06-12 14:46 ` [pve-devel] applied: " Thomas Lamprecht
0 siblings, 1 reply; 2+ messages in thread
From: Christian Ebner @ 2023-06-12 10:31 UTC (permalink / raw)
To: pve-devel
Checking /lib/systemd if it is present and a directory is not enough, as
the shared object file used to check the version might nevertheless be
located at /usr/lib/systemd, or under /usr/lib/x86_64-linux-gnu/systemd.
So check also the latter paths, if the former returned no match.
Further, Arch Linux appends the minor version and release version to the
filename, so include that in the regex as well.
Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
---
Changes since v1:
- Also check for shared object in /usr/lib/x86_64-linux-gnu/systemd
PVE/CLI/pve7to8.pm | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/PVE/CLI/pve7to8.pm b/PVE/CLI/pve7to8.pm
index 6b51e98e..09e7cc65 100644
--- a/PVE/CLI/pve7to8.pm
+++ b/PVE/CLI/pve7to8.pm
@@ -1015,9 +1015,14 @@ sub check_containers_cgroup_compat {
my $get_systemd_version = sub {
my ($self) = @_;
- my $sd_lib_dir = -d "/lib/systemd" ? "/lib/systemd" : "/usr/lib/systemd";
- my $libsd = PVE::Tools::dir_glob_regex($sd_lib_dir, "libsystemd-shared-.+\.so");
- if (defined($libsd) && $libsd =~ /libsystemd-shared-(\d+)\.so/) {
+ my $libsd = PVE::Tools::dir_glob_regex("/lib/systemd", "libsystemd-shared-.+\.so");
+ if (!defined($libsd)) {
+ $libsd = PVE::Tools::dir_glob_regex("/usr/lib/systemd", "libsystemd-shared-.+\.so");
+ }
+ if (!defined($libsd)) {
+ $libsd = PVE::Tools::dir_glob_regex("/usr/lib/x86_64-linux-gnu/systemd", "libsystemd-shared-.+\.so");
+ }
+ if (defined($libsd) && $libsd =~ /libsystemd-shared-(\d+)(\.\d-\d)?\.so/) {
return $1;
}
--
2.39.2
^ permalink raw reply [flat|nested] 2+ messages in thread
* [pve-devel] applied: [PATCH v2 manager] pve7to8: Improve systemd unified cgroupv2 support check
2023-06-12 10:31 [pve-devel] [PATCH v2 manager] pve7to8: Improve systemd unified cgroupv2 support check Christian Ebner
@ 2023-06-12 14:46 ` Thomas Lamprecht
0 siblings, 0 replies; 2+ messages in thread
From: Thomas Lamprecht @ 2023-06-12 14:46 UTC (permalink / raw)
To: Proxmox VE development discussion, Christian Ebner
Am 12/06/2023 um 12:31 schrieb Christian Ebner:
> Checking /lib/systemd if it is present and a directory is not enough, as
> the shared object file used to check the version might nevertheless be
> located at /usr/lib/systemd, or under /usr/lib/x86_64-linux-gnu/systemd.
> So check also the latter paths, if the former returned no match.
>
> Further, Arch Linux appends the minor version and release version to the
> filename, so include that in the regex as well.
>
> Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
> ---
> Changes since v1:
> - Also check for shared object in /usr/lib/x86_64-linux-gnu/systemd
>
> PVE/CLI/pve7to8.pm | 11 ++++++++---
> 1 file changed, 8 insertions(+), 3 deletions(-)
>
>
applied, tranformed into a loop in a follow up though, thanks!
fwiw, we have some experimental support for ARM/RSIC-V containers via the
binfmt_misc + qemu mechanism, but those are not fully supported for now
so I think it's ok to ignore that here...
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-06-12 14:46 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-12 10:31 [pve-devel] [PATCH v2 manager] pve7to8: Improve systemd unified cgroupv2 support check Christian Ebner
2023-06-12 14:46 ` [pve-devel] applied: " Thomas Lamprecht
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox