Skip to content

Commit

Permalink
make podman-clean-transient.service work as user
Browse files Browse the repository at this point in the history
In the user session there is no boot-complete.target so the Requires=
fails. We do not need it and I am not sure if we need it for the root
unit either but I deicded to keep it there to not change anything and
for the user session we patch it out.

I patched this in the Makefile, while we could try to define two
different source files for that it would make the Makefile logic even
more complicated. In particular as this file is a .in we would need to
add it to PODMAN_GENERATED_UNIT_FILES and then somehow fix the loop. To
much work IMO so the sed trick to patch the user file is simpler.

Fixes #23790

Signed-off-by: Paul Holzinger <[email protected]>
  • Loading branch information
Luap99 committed Oct 30, 2024
1 parent f139bc1 commit 6b8e8cb
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -1000,6 +1000,13 @@ install.systemd: $(PODMAN_GENERATED_UNIT_FILES)
install ${SELINUXOPT} -m 644 $$unit $(DESTDIR)${USERSYSTEMDDIR}/$$(basename $$unit); \
install ${SELINUXOPT} -m 644 $$unit $(DESTDIR)${SYSTEMDDIR}/$$(basename $$unit); \
done
# HACK; as rootless this unit will not work due the requires on a non existing target
# as the user session does not see system units. We could define two different units
# but this seems much more complicated then this small fixup here.
# https://github.com/containers/podman/issues/23790
sed -i '/Requires=/d' $(DESTDIR)${USERSYSTEMDDIR}/podman-clean-transient.service
sed -i '/After=/d' $(DESTDIR)${USERSYSTEMDDIR}/podman-clean-transient.service

# Important this unit should only be installed for the user session and is thus not added to the loop above.
install ${SELINUXOPT} -m 644 contrib/systemd/user/podman-user-wait-network-online.service \
$(DESTDIR)${USERSYSTEMDDIR}/podman-user-wait-network-online.service
Expand Down

0 comments on commit 6b8e8cb

Please sign in to comment.