all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: "Fabian Grünbichler" <f.gruenbichler@proxmox.com>
To: Proxmox VE development discussion <pve-devel@lists.proxmox.com>
Cc: Wolfgang Bumiller <w.bumiller@proxmox.com>
Subject: Re: [pve-devel] [PATCH container] lxc config: mount /dev/shm tmpfs for application containers
Date: Thu, 15 Jan 2026 11:08:53 +0100	[thread overview]
Message-ID: <1768471697.tyq6frrd7n.astroid@yuna.none> (raw)
In-Reply-To: <20251202152733.204787-1-f.schauer@proxmox.com>

On December 2, 2025 4:27 pm, Filip Schauer wrote:
> Mount a tmpfs at /dev/shm into containers without an init system which
> would normally set up a shared memory filesystem. This satisfies the OCI
> Runtime Spec [0], which specifies that the following should be made
> available in the container:
> /proc       proc
> /sys        sysfs
> /dev/pts    devpts
> /dev/shm    tmpfs
> 
> The reason the mount is added conditionally is to avoid interfering with
> init systems: systemd correctly detects an existing /dev/shm, but OpenRC
> mounts it even if already present, resulting in duplicate mounts.
> 
> [0] https://github.com/opencontainers/runtime-spec/blob/fd25dd34a06b/config-linux.md#default-filesystems
> 
> Signed-off-by: Filip Schauer <f.schauer@proxmox.com>

Reviewed-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>

@Wolfang - could you also take a look to ensure I haven't missed any
implications?

> ---
>  src/PVE/LXC.pm | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/src/PVE/LXC.pm b/src/PVE/LXC.pm
> index de54a0d..e5ff3a1 100644
> --- a/src/PVE/LXC.pm
> +++ b/src/PVE/LXC.pm
> @@ -756,6 +756,11 @@ sub update_lxc_config {
>          $raw .= "lxc.mount.auto = sys:mixed\n";
>      }
>  
> +    if (defined($conf->{entrypoint}) && $conf->{entrypoint} ne '/sbin/init') {
> +        # Mount /dev/shm tmpfs into the container, if no init system runs to set it up.
> +        $raw .= "lxc.mount.entry = shm dev/shm tmpfs rw,nosuid,nodev,create=dir 0 0\n";
> +    }
> +
>      PVE::LXC::Config->foreach_passthrough_device(
>          $conf,
>          sub {
> -- 
> 2.47.3
> 
> 
> 
> _______________________________________________
> pve-devel mailing list
> pve-devel@lists.proxmox.com
> https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
> 
> 
> 


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

      reply	other threads:[~2026-01-15 10:08 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-02 15:27 Filip Schauer
2026-01-15 10:08 ` Fabian Grünbichler [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=1768471697.tyq6frrd7n.astroid@yuna.none \
    --to=f.gruenbichler@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    --cc=w.bumiller@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