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

Use /tmp/podman-run-* for backup XDG_RUNTIME_DIR #8241

Merged
merged 1 commit into from
Nov 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,8 @@ install.bin-nobuild:
install ${SELINUXOPT} -d -m 755 $(DESTDIR)$(BINDIR)
install ${SELINUXOPT} -m 755 bin/podman $(DESTDIR)$(BINDIR)/podman
test -z "${SELINUXOPT}" || chcon --verbose --reference=$(DESTDIR)$(BINDIR)/podman bin/podman
install ${SELINUXOPT} -m 755 -d ${DESTDIR}${TMPFILESDIR}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For historical purposes, could you add a comment here explaining this?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You want a comment in the man page explaining why we are installing podman.conf, or do you want a comment in podman.conf telling you what the line in their is for? Telling systemd to not prune /tmp/podman-run-*?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking of just a comment here explaining the change with a pointer to the issue. If you think a man page change would serve better, and/or a comment in /tmp/podman-run-* I'm fine with either or both. Just so that two years from now someone doesn't remove it without realizing it's need.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am just thinking the message should go into the podman.conf file. Not here. If I am removing content, I am likely to read the file. Added explanation to podman.conf file.

install ${SELINUXOPT} -m 644 contrib/tmpfile/podman.conf ${DESTDIR}${TMPFILESDIR}/podman.conf

.PHONY: install.bin
install.bin: podman install.bin-nobuild
Expand Down Expand Up @@ -531,14 +533,13 @@ install.docker: docker-docs
.PHONY: install.varlink
ifneq (,$(findstring varlink,$(BUILDTAGS)))
install.varlink:
install ${SELINUXOPT} -m 755 -d ${DESTDIR}${SYSTEMDDIR} ${DESTDIR}${USERSYSTEMDDIR} ${DESTDIR}${TMPFILESDIR}
install ${SELINUXOPT} -m 755 -d ${DESTDIR}${SYSTEMDDIR} ${DESTDIR}${USERSYSTEMDDIR}
install ${SELINUXOPT} -m 644 contrib/varlink/io.podman.socket ${DESTDIR}${SYSTEMDDIR}/io.podman.socket
install ${SELINUXOPT} -m 644 contrib/varlink/io.podman.socket ${DESTDIR}${USERSYSTEMDDIR}/io.podman.socket
install ${SELINUXOPT} -m 644 contrib/varlink/io.podman.service ${DESTDIR}${SYSTEMDDIR}/io.podman.service
# User units are ordered differently, we can't make the *system* multi-user.target depend on a user unit.
# For user units the default.target that's the default is fine.
sed -e 's,^WantedBy=.*,WantedBy=default.target,' < contrib/varlink/io.podman.service > ${DESTDIR}${USERSYSTEMDDIR}/io.podman.service
install ${SELINUXOPT} -m 644 contrib/varlink/podman.conf ${DESTDIR}${TMPFILESDIR}/podman.conf
else
install.varlink:
endif
Expand Down
1 change: 1 addition & 0 deletions contrib/spec/podman.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,7 @@ export GOPATH=%{buildroot}/%{gopath}:$(pwd)/vendor:%{gopath}
%{_usr}/lib/systemd/user/podman.socket
%{_usr}/lib/systemd/user/podman-auto-update.service
%{_usr}/lib/systemd/user/podman-auto-update.timer
%{_usr}/lib/tmpfiles.d/podman.conf

%if 0%{?with_devel}
%files -n libpod-devel -f devel.file-list
Expand Down
4 changes: 4 additions & 0 deletions contrib/tmpfile/podman.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# /tmp/podman-run-* directory can contain content for Podman containers that have run
# for many days. This following line prevents systemd from removing this content.
x /tmp/podman-run-.*
d /run/podman 0700 root root
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

1 change: 0 additions & 1 deletion contrib/varlink/podman.conf

This file was deleted.

2 changes: 1 addition & 1 deletion pkg/util/utils_supported.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func GetRuntimeDir() (string, error) {
}
}
if runtimeDir == "" {
tmpDir := filepath.Join(os.TempDir(), fmt.Sprintf("run-%s", uid))
tmpDir := filepath.Join(os.TempDir(), fmt.Sprintf("podman-run-%s", uid))
if err := os.MkdirAll(tmpDir, 0700); err != nil {
logrus.Debug(err)
}
Expand Down