Files
podman/contrib/systemd/system/podman-clean-transient.service.in
Alexander Larsson ddeb9592c9 Add podman-clean-transient.service service
This is a unit that can be enabled when using transient store mode
to clean up potential leftovers from previous boots. All it does is
run "podman system prune --external" once each boot.

Signed-off-by: Alexander Larsson <alexl@redhat.com>
2022-12-20 10:24:25 +01:00

22 lines
662 B
SYSTEMD

# This service runs once each boot to remove potential leftover
# container state from previous boots.
# This is needed when using transient storage mode in podman where the
# database and other configs are stored in tmpfs, but some other files
# are not. If we don't run this after an unclean boot then there may
# be some leftover files that grow over time.
[Unit]
Description=Clean up podman transient data
RequiresMountsFor=%t/containers
Documentation=man:podman-system-prune(1)
Requires=boot-complete.target
After=local-fs.target boot-complete.target
[Service]
Type=oneshot
ExecStart=@@PODMAN@@ system prune --external
[Install]
WantedBy=default.target