Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

qm.container mounts /var/tmp as tmpfs #723

Open
alexlarsson opened this issue Feb 13, 2025 · 5 comments · May be fixed by #727
Open

qm.container mounts /var/tmp as tmpfs #723

alexlarsson opened this issue Feb 13, 2025 · 5 comments · May be fixed by #727
Assignees
Labels

Comments

@alexlarsson
Copy link
Collaborator

qm.container has ReadOnly=true, which maps to podman run --read-only.
This tells podman to mount the container image read-only, and then mount a tmpfs on top of /tmp, /run and /var/tmp.

However, in QM, /var/tmp is generally on top of the /var volume (which comes from /var/qm on the host), and we don't want this part to be a tmpfs, because that limits the size of /var/tmp files in the qm partition, and this is not expected (e.g. it is different than on what normally happens in rhel, where /tmp is ram and /var/tmp is disk based).

I think we need to pass some extra argument to manually configure /tmp and /run as tmpfs, with not special options for /var/tmp (so its just picked up from the volume).

I think what we want is
ReadOnly=true
ReadOnlyTmpfs=false
Mount=type=tmpfs,tmpfs-size=512M,destination=/tmp
Mount=type=tmpfs,tmpfs-size=512M,destination=/run

@alexlarsson
Copy link
Collaborator Author

@rhatdan does this make sense to you?

@rhatdan
Copy link
Member

rhatdan commented Feb 20, 2025

Yes.

Since /var is already a r/w mount point, this will leave the directory writeable.

Does this work with a file system rootfs? I did not know that we implemented a read/only --rootfs feature.

dougsland added a commit that referenced this issue Feb 21, 2025
Resolves: #723
Signed-off-by: Douglas Schilling Landgraf <[email protected]>
@dougsland dougsland linked a pull request Feb 21, 2025 that will close this issue
@dougsland dougsland self-assigned this Feb 21, 2025
@dougsland dougsland added the jira label Feb 21, 2025
@dougsland
Copy link
Collaborator

dougsland commented Feb 21, 2025

@rhatdan @alexlarsson I asked QE to test this. cc @pengshanyu

@dougsland
Copy link
Collaborator

See-Also: #722

@pengshanyu
Copy link
Collaborator

I verified that the following configuration works:

ReadOnly=true
ReadOnlyTmpfs=false
Mount=type=tmpfs,tmpfs-size=512M,destination=/tmp
Mount=type=tmpfs,tmpfs-size=512M,destination=/run
Mount=type=tmpfs,destination=/dev/shm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants