From: Christian Ebner <c.ebner@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: Re: [pve-devel] [PATCH] pve7to8: Improve systemd unified cgroupv2 support check
Date: Mon, 12 Jun 2023 12:21:49 +0200 (CEST) [thread overview]
Message-ID: <2031035742.992.1686565309810@webmail.proxmox.com> (raw)
In-Reply-To: <20230612100640.32337-1-c.ebner@proxmox.com>
Ignore this one, it is still incomplete as Debian 12 stores the shared object at /usr/lib/x86_64-linux-gnu/systemd. Will include that too and send a v2.
> On 12.06.2023 12:06 CEST Christian Ebner <c.ebner@proxmox.com> wrote:
>
>
> 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. So check also the latter, 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>
> ---
> PVE/CLI/pve7to8.pm | 8 +++++---
> 1 file changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/PVE/CLI/pve7to8.pm b/PVE/CLI/pve7to8.pm
> index 6b51e98e..3061b691 100644
> --- a/PVE/CLI/pve7to8.pm
> +++ b/PVE/CLI/pve7to8.pm
> @@ -1015,9 +1015,11 @@ 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 =~ /libsystemd-shared-(\d+)(\.\d-\d)?\.so/) {
> return $1;
> }
>
> --
> 2.39.2
prev parent reply other threads:[~2023-06-12 10:21 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-12 10:06 Christian Ebner
2023-06-12 10:21 ` Christian Ebner [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2031035742.992.1686565309810@webmail.proxmox.com \
--to=c.ebner@proxmox.com \
--cc=pve-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.