all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Fiona Ebner <f.ebner@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH container 4/4] seccomp config: adapt to new lxc-syscalld runtime directory
Date: Tue, 13 May 2025 12:56:52 +0200	[thread overview]
Message-ID: <20250513105652.67403-5-f.ebner@proxmox.com> (raw)
In-Reply-To: <20250513105652.67403-1-f.ebner@proxmox.com>

The lxc-syscalld now uses a different runtime directory. Its old
runtime directory was /run/pve, which was also used for other things,
e.g. storage tunnel and mtunnel sockets and container stderr logs as
well as pull metrics. The fact that it would be recreated on service
restart is problematic, so the runtime directory was changed.

Note that this configuration is only used for containers with the
experimental 'mknod' feature enabled.

For already running containers, a symbolic link is put into place by
the new version of pve-lxc-syscalld, but newly started ones should
always use the new socket path as soon as it is available. Only use
the old socket path if the old version of pve-lxc-syscalld is still
used. The heuristic to check this is:
1. the new socket path doesn't exist
2. the old socket path exists
3. the old socket path is not a symbolic link

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
---
 src/PVE/LXC.pm | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/src/PVE/LXC.pm b/src/PVE/LXC.pm
index 2b9f0cf..c42fdde 100644
--- a/src/PVE/LXC.pm
+++ b/src/PVE/LXC.pm
@@ -525,7 +525,15 @@ sub make_seccomp_config {
 	    die "'mknod' feature requested, but kernel too old (found $kernel, required >= 5.3)\n";
 	}
 
-	$raw_conf .= "lxc.seccomp.notify.proxy = unix:/run/pve/lxc-syscalld.sock\n";
+	# TODO PVE 10 - always use new socket path
+	my $old_socket_path = '/run/pve/lxc-syscalld.sock';
+	my $new_socket_path = '/run/pve-lxc-syscalld/lxc-syscalld.sock';
+
+	if (!-e $new_socket_path && -e $old_socket_path && !-l $old_socket_path) {
+	    $raw_conf .= "lxc.seccomp.notify.proxy = unix:$old_socket_path\n";
+	} else {
+	    $raw_conf .= "lxc.seccomp.notify.proxy = unix:$new_socket_path\n";
+	}
 	$raw_conf .= "lxc.seccomp.notify.cookie = $vmid\n";
 
 	$rules->{mknod} = [
-- 
2.39.5



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


      parent reply	other threads:[~2025-05-13 10:57 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-13 10:56 [pve-devel] [RFC manager/lxc-syscalld/container 0/4] avoid using generic runtime directory name for pve-lxc-syscalld Fiona Ebner
2025-05-13 10:56 ` [pve-devel] [PATCH manager 1/4] add tpmfiles.d config to create /run/pve directory Fiona Ebner
2025-05-14 18:08   ` Thomas Lamprecht
2025-05-15  8:26     ` Fiona Ebner
2025-05-13 10:56 ` [pve-devel] [PATCH pve-lxc-syscalld 2/4] service: avoid using generic runtime directory name Fiona Ebner
2025-05-14 14:33   ` Thomas Lamprecht
2025-05-15  8:41     ` Fiona Ebner
2025-05-15  9:24       ` Thomas Lamprecht
2025-05-13 10:56 ` [pve-devel] [PATCH pve-lxc-syscalld 3/4] d/postinst: create link to new socket location on upgrade Fiona Ebner
2025-05-13 10:56 ` Fiona 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=20250513105652.67403-5-f.ebner@proxmox.com \
    --to=f.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.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal