-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
TMPDIR isn't used for committing containers when connecting to a remote Podman service #20839
Comments
@primeos-work I think the issue is happening that env Can you share entire service file ? If it helps there is a field to configure |
@flouthoc thanks a lot for the quick reply and trying to reproduce this issue! :) That's weird that it seems to work in your case. Are you sure that no "container_images_storage*" files ended up in
The best test might be to restrict the user or systemd service from writing to
Sure :) systemctl-cat output (I only added the last file via systemctl-edit)[michael@groot ~]$ systemctl --user cat podman.socket
# /usr/lib/systemd/user/podman.socket
[Unit]
Description=Podman API Socket
Documentation=man:podman-system-service(1)
[Socket]
ListenStream=%t/podman/podman.sock
SocketMode=0660
[Install]
WantedBy=sockets.target
[michael@groot ~]$ systemctl --user cat podman.service
# /usr/lib/systemd/user/podman.service
[Unit]
Description=Podman API Service
Requires=podman.socket
After=podman.socket
Documentation=man:podman-system-service(1)
StartLimitIntervalSec=0
[Service]
Delegate=true
Type=exec
KillMode=process
Environment=LOGGING="--log-level=info"
ExecStart=/usr/bin/podman $LOGGING system service
[Install]
WantedBy=default.target
# /usr/lib/systemd/user/service.d/10-timeout-abort.conf
# This file is part of the systemd package.
# See https://fedoraproject.org/wiki/Changes/Shorter_Shutdown_Timer.
#
# To facilitate debugging when a service fails to stop cleanly,
# TimeoutStopFailureMode=abort is set to "crash" services that fail to stop in
# the time allotted. This will cause the service to be terminated with SIGABRT
# and a coredump to be generated.
#
# To undo this configuration change, create a mask file:
# sudo mkdir -p /etc/systemd/user/service.d
# sudo ln -sv /dev/null /etc/systemd/user/service.d/10-timeout-abort.conf
[Service]
TimeoutStopFailureMode=abort
# /home/michael/.config/systemd/user/podman.service.d/override.conf
[Service]
Environment="TMPDIR=/tmp/podman" I also added the
The |
My bad I did not actually verify if files are being created in different directory I only checked value of |
Issue Description
Podman supports the
TMPDIR
environment variable to "Set the temporary storage location of downloaded container images. Podman defaults to use/var/tmp
."This works as expected until one connects to a Podman service (
--remote
,--connection
,$CONTAINER_HOST
, etc.) despite the Podman service having$TMPDIR
set.Most temporary files still end up in
TMPDIR
, only(?) the files prefixed withcontainer_images_storage
end up in/var/tmp
instead of$TMPDIR
.See containers/image#2197 for technical details.
I first reported this issue at containers/image (containers/image#2197) as it could(/should?) be prevented there as well (which should ideally be done too, IMO) but I guess it should mainly be fixed on Podman's side (s. containers/image#2197 (comment)) by setting
sys.BigFilesTemporaryDir
to$TMPDIR
for that code path as well.I've hit this issue on a RHEL9 system and reproduced this on a Fedora 38 system with Podman 4.8.0 using the steps below.
Some relevant output to confirm that the setup should be correct:
cc @mtrmac (FYI / due to the other issue in the c/image repo)
Steps to reproduce the issue
Steps to reproduce the issue:
dnf install podman --enablerepo=updates-testing,updates-testing-modular --best
systemctl --user start podman.socket
$TMPDIR
(Podman service + shell env (the latter likely shouldn't matter))/var/tmp
for files (find /var/tmp/ -maxdepth 1 -name "container_images_storage*"
)Note: I used a Fedora 38 system for testing.
One can also temporarily restrict Podman from writing to
/var/tmp
to trigger such errors instead:Describe the results you received
Podman creates files/directories in
/var/tmp
. This became an issue on a RHEL9 system where/var/tmp
is on atmpfs
and the container images/layers are so large that it cannot fit (RAM+swap too small).Describe the results you expected
All temporary files should end up in
$TMPDIR
.podman info output
Podman in a container
No
Privileged Or Rootless
Rootless
Upstream Latest Release
Yes
Additional environment details
A "normal" test/dev VM with Fedora Linux.
Additional information
Only happens when connecting to a Podman service - doesn't matter if privileged or rootless.
The text was updated successfully, but these errors were encountered: