Bug 2149642
| Summary: | systemd presets request - podman-restart | ||
|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | Daniel Walsh <dwalsh> |
| Component: | fedora-release | Assignee: | Stephen Gallagher <sgallagh> |
| Status: | CLOSED RAWHIDE | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
| Severity: | medium | Docs Contact: | |
| Priority: | medium | ||
| Version: | rawhide | CC: | dustymabe, fedoraproject, jkeating, jlebon, kevin, mboddu, pbrobinson, sgallagh, thrcka, walters, zbyszek |
| Target Milestone: | --- | ||
| Target Release: | --- | ||
| Hardware: | All | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | If docs needed, set a value | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2023-01-09 20:48:47 UTC | Type: | --- |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
|
Description
Daniel Walsh
2022-11-30 13:48:53 UTC
This service pulls in network-online.target. As documented in https://systemd.io/NETWORK_ONLINE/, network-online.target in general should be avoided in favour of more dynamic approaches. It's unfortunate to have an enabled-by-default service using it. Since `--restart=always` is documented as "retrying indefinitely", it seems reasonable to instead have it automatically keep retrying if networking isn't yet up. Another approach would be for podman to only enable this service when a `--restart=always` container is actually started (and disabled if the last `--restart=always` container is removed). For the record, we've been bit by having `network-online.target` enabled in FCOS in the past so we wrote a test that now fails if it gets pulled in by default, which is why we ended up here. https://github.com/coreos/fedora-coreos-tracker/issues/1380#issuecomment-1382221004 A slightly more efficient approach here would be to: - Change podman to have a file /var/lib/containers/autostart-enabled that exists iff an autostart container exists - Have the systemd unit use ConditionPathExists=/var/lib/containers/autostart-enabled This way we shave off loading and executing podman and scanning all containers (right?) on every boot even for people who don't use this feature > - Have the systemd unit use ConditionPathExists=/var/lib/containers/autostart-enabled
This won't work because systemd doesn't consider ConditionPathExists when setting up the transaction. Conditions are evaluated right before the service is scheduled to start IIRC. We use generators to work around this in our code, which would work here too of course.
Right sorry, I was not trying to directly solve the Requires=network-online.target problem. Why would that even be required? Probably a cut and paste from an existing PR. I guess they wanted to start the service as soon as the network is up. Please open a PR to how you would like it to look. Yeah agree, time to stop writing text in bugzilla and write code in a PR. Filed https://github.com/containers/podman/pull/17110 |