Always mount a /run tmpfs in the container#5655
Conversation
|
Do we need to verify if /run is already setup and non-empty in the provided rootfs before mounting a tmpfs over it? We might be hiding away an existing tmpfs setup in some cases. |
|
@rjnagal How could there be another tmpfs already set up? We've just mounted the root fs ourselves. Now, its possible that the image had some files in /run, which we may hide. However, that is quite unlikely as any images that use standard distro packages will see the same behaviour on a normal boot. |
|
This shouldn't be a problem for standard distros. It can only break custom On Wed, May 7, 2014 at 11:18 PM, Alexander Larsson <notifications@github.com
|
|
@rjnagal When would you want that? I can see using that as a volume, and yes, that would break with this as the /run would cover the files we create to bind-mount on. Thats already broken for /dev for the same reasons: |
|
@alexlarsson that's the thing I am seeing. I mistook 'system mounts in init On Thu, May 8, 2014 at 10:41 AM, Alexander Larsson <notifications@github.com
|
|
This last change allows volumes in /run to work in the native driver. However, i'm not sure how to do this in lxc... |
All modern distros set up /run to be a tmpfs, see for instance: https://wiki.debian.org/ReleaseGoals/RunDirectory Its a very useful place to store pid-files, sockets and other things that only live at runtime and that should not be stored in the image. This is also useful when running systemd inside a container, as it will try to mount /run if not already mounted, which will fail for non-privileged container. Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
|
New rebase that dropped the /dev/log fix as that is already in master now. |
|
ping @creack do you think that doing this is ok? |
|
Yes. Will try today. |
|
LGTM |
|
LGTM I don't have pull permissions, but it looks fine to me. On Mon, May 12, 2014 at 3:12 PM, Guillaume J. Charmes <
|
|
LGTM lmctfy has started to do this as well so I'm definitely already in the /run as tmpfs camp :) |
|
LGTM |
Always mount a /run tmpfs in the container
All modern distros set up /run to be a tmpfs, see for instance:
https://wiki.debian.org/ReleaseGoals/RunDirectory
Its a very useful place to store pid-files, sockets and other things
that only live at runtime and that should not be stored in the image.
This is also useful when running systemd inside a container, as it
will try to mount /run if not already mounted, which will fail for
non-privileged container.
Docker-DCO-1.1-Signed-off-by: Alexander Larsson alexl@redhat.com (github: alexlarsson)