Bug 1792173
| Summary: | Ordering cycle introduced by tangd.socket during boot | ||||||
|---|---|---|---|---|---|---|---|
| Product: | Red Hat Enterprise Linux 8 | Reporter: | Renaud Métrich <rmetrich> | ||||
| Component: | tang | Assignee: | Sergio Correia <scorreia> | ||||
| Status: | CLOSED DUPLICATE | QA Contact: | BaseOS QE Security Team <qe-baseos-security> | ||||
| Severity: | high | Docs Contact: | |||||
| Priority: | high | ||||||
| Version: | 8.1 | CC: | dapospis, scorreia | ||||
| Target Milestone: | rc | Flags: | pm-rhel:
mirror+
|
||||
| Target Release: | 8.0 | ||||||
| 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: | 2020-02-13 11:12:46 UTC | Type: | Bug | ||||
| Regression: | --- | Mount Type: | --- | ||||
| Documentation: | --- | CRM: | |||||
| Verified Versions: | Category: | --- | |||||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
| Cloudforms Team: | --- | Target Upstream Version: | |||||
| Embargoed: | |||||||
| Attachments: |
|
||||||
|
Description
Renaud Métrich
2020-01-17 08:23:49 UTC
Currently, we have "tangd.socket" require/after "tangd-keygen.service" and "tangd-update.service". Additionally the socket is installed in "multi-user.target": /usr/lib/systemd/system/tangd.socket: -------- 8< ---------------- 8< ---------------- 8< ---------------- 8< -------- [Unit] Description=Tang Server socket Requires=tangd-keygen.service Requires=tangd-update.service Requires=tangd-update.path After=tangd-keygen.service After=tangd-update.service [Socket] ListenStream=80 Accept=true [Install] WantedBy=multi-user.target -------- 8< ---------------- 8< ---------------- 8< ---------------- 8< -------- It looks weird to me that a *socket* depends on *services* or *paths*. Due to having a socket, we have systemd automatically add a "After" dependency on "sockets.target" (this is Issue 1 to be investigate), which creates the ordering cycle. For some reason, the same dependency was happening on RHEL7 but didn't create an ordering cycle. To fix all this, I propose the following changes: 1. Implement a "regular" socket, installed in "sockets.target" with no dependencies /usr/lib/systemd/system/tangd.socket: -------- 8< ---------------- 8< ---------------- 8< ---------------- 8< -------- [Unit] Description=Tang Server socket [Socket] ListenStream=80 Accept=true [Install] WantedBy=sockets.target -------- 8< ---------------- 8< ---------------- 8< ---------------- 8< -------- 2. Move the dependencies in "tangd@.service" unit which is where dependencies have to be handled /usr/lib/systemd/system/tangd@.service: -------- 8< ---------------- 8< ---------------- 8< ---------------- 8< -------- [Unit] Description=Tang Server Requires=tangd-keygen.service After=tangd-keygen.service [Service] StandardInput=socket StandardOutput=socket StandardError=journal ExecStart=/usr/libexec/tangd /var/cache/tang User=tang -------- 8< ---------------- 8< ---------------- 8< ---------------- 8< -------- Note here that I removed the dependency on "tangd-update.path" and "tangd-update.service" since I consider that they are not needed at all: - tangd-update.path monitors changes in Tang keys, this has nothing to do with "tangd@.service" instances - tangd-update.service updates the cache with new keys, this has nothing to do with "tangd@.service" instances either Please correct me if I'm wrong with the logic. With this in place, the ordering cycle just disappear, "tangd.socket" becomes a regular socket, and, when it triggers an instance of "tangd@.service", systemd will check that there is indeed Tang keys to use. Note for packaging: the postinstall RPM scriptlet should re-enable the socket upon package upgrade since it moved from "multi-user.target" to "sockets.target". Created attachment 1652978 [details]
Proposed updated tangd units
Issue 1 is tracked by BZ #1792219 |