-
Notifications
You must be signed in to change notification settings - Fork 27
container/commit: Auto-clean /var/tmp
, /tmp
, /run
#367
container/commit: Auto-clean /var/tmp
, /tmp
, /run
#367
Conversation
This pairs with #366 |
35d87ad
to
22d8837
Compare
I do like the empty directories /var autocleaning, it's a clear UX improvement. It assumes there is something re-creating those on boot (e.g. tmpfiles.d fragment or the software itself), but I think that's fine. And we can always implement auto-translation to tmpfiles.d here in the future if we want. I'm less convinced about inspecting |
22d8837
to
6182cc4
Compare
/run
/var/tmp
, /tmp
, /run
Good feedback! Fixed. For example, we no longer warn about anything in |
6182cc4
to
41c7f33
Compare
Tangentially related, cc containers/buildah#4242 for a podman bug we may also want to work around in this code. |
The original command here was just scoped to `/var`, but we also don't want content in `/run`. Extend the tooling to handle that and the other two temporary directories. Also, let's be a bit nicer here and auto-clean empty directories in `/var`. I was testing out the https://github.com/coreos/coreos-layering-examples/blob/main/tailscale/Dockerfile example and today we have this: ``` drwxr-xr-x root/root 0 2022-09-13 18:53 run/ drwxr-xr-x root/root 0 2022-09-13 18:51 run/rpm-ostree/ drwxr-xr-x root/root 0 2022-09-13 18:53 run/rpm-ostree/lock/ drwxr-xr-x root/root 0 2022-09-13 18:51 run/systemd/ drwxr-xr-x root/root 0 2022-09-13 18:51 run/systemd/resolve/ -rwx------ root/root 0 2022-09-13 18:51 run/systemd/resolve/stub-resolv.conf ... drwxr-xr-x root/root 0 2022-09-13 18:53 var/ drwxr-xr-x root/root 0 2022-09-13 18:53 var/cache/ drwx------ root/root 0 2022-09-13 18:53 var/cache/ldconfig/ -rw------- root/root 22000 2022-09-13 18:53 var/cache/ldconfig/aux-cache drwxr-xr-x root/root 0 2022-09-08 23:10 var/cache/tailscale/ drwxr-xr-x root/root 0 2022-09-13 18:53 var/tmp/ ``` In this set, we can auto-clean the leftover locking directories rpm-ostree (erroneously) leaves in `/run`, as well as `/var/cache/ldconfig`.
I think it makes sense for us to use this in rpm-ostree directly too at build time for example.
41c7f33
to
b43fe6f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code LGTM, but CI needs some tweaking.
721a79e
to
5351c00
Compare
To verify our changes there too.
5351c00
to
972a134
Compare
Got the new CI green 🎉 |
This command just deletes content from `/var/cache`, but that's no longer needed since it's part of ostreedev/ostree-rs-ext#367
The original command here was just scoped to
/var
, but we alsodon't want content in
/run
. Extend the tooling to handle thatand the other two temporary directories.
Also, let's be a bit nicer here and auto-clean empty directories
in
/var
.I was testing out the
https://github.com/coreos/coreos-layering-examples/blob/main/tailscale/Dockerfile
example and today we have this:
In this set, we can auto-clean the leftover locking directories
rpm-ostree (erroneously) leaves in
/run
.I am tempted to auto-cleanup the
stub-resolv.conf
thing and theldconfig/aux-cache
.