Bug 2056542
| Summary: | Missing dependency on home dir for user@.service unit | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 8 | Reporter: | Renaud Métrich <rmetrich> |
| Component: | systemd | Assignee: | Jacek Migacz <jmigacz> |
| Status: | CLOSED MIGRATED | QA Contact: | Frantisek Sumsal <fsumsal> |
| Severity: | high | Docs Contact: | |
| Priority: | high | ||
| Version: | 8.5 | CC: | dtardon, dwoodruf, jmigacz, qguo, systemd-maint-list |
| Target Milestone: | rc | Keywords: | Improvement, MigratedToJIRA, Reproducer |
| Target Release: | --- | Flags: | pm-rhel:
mirror+
|
| 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-09-21 11:27:45 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: | |||
| Bug Depends On: | 2056527 | ||
| Bug Blocks: | |||
|
Description
Renaud Métrich
2022-02-21 13:26:11 UTC
If the home dir is available through an autofs map, then the following drop-in needs to be added as well: -------- 8< ---------------- 8< ---------------- 8< ---------------- 8< -------- After=autofs.service Wants=autofs.service -------- 8< ---------------- 8< ---------------- 8< ---------------- 8< -------- Adding all this as default should be pretty harmless. (In reply to Renaud Métrich from comment #0) > IMHO user@.service should have the following property added, so that it gets > delayed until home dir is available: > -------- 8< ---------------- 8< ---------------- 8< ---------------- 8< > -------- > RequiresMountsFor=%h > -------- 8< ---------------- 8< ---------------- 8< ---------------- 8< > -------- This sounds reasonable to me. > If the home dir is available through an autofs map, then the following > drop-in needs to be added as well: > -------- 8< ---------------- 8< ---------------- 8< ---------------- 8< > -------- > After=autofs.service > Wants=autofs.service > -------- 8< ---------------- 8< ---------------- 8< ---------------- 8< > -------- > > Adding all this as default should be pretty harmless. But this does not. This is what synchronization targets are for. autofs.service should contain Wants=remote-fs-pre.target Before=remote-fs-pre.target so, if it's *enabled*, it's guaranteed to be started before mounts are used (all "_netdev" "auto" mounts have After=remote-fs-pre.target).
> But this does not. This is what synchronization targets are for.
> autofs.service should contain
>
> Wants=remote-fs-pre.target
> Before=remote-fs-pre.target
>
> so, if it's *enabled*, it's guaranteed to be started before mounts are used
> (all "_netdev" "auto" mounts have After=remote-fs-pre.target).
This doesn't work, because home dirs provided by autofs.service are not known to systemd at all before autofs.service really started (then they are known through the autofs mount point).
Also currently autofs.service even starts After=remote-fs.target, likely because autofs mount points can be set on top of static remote file systems in /etc/fstab.
Maybe this can be optimized by modifying autofs.service to also have a Wants=remote-fs.target so that the latter is really reached once autofs.service is started, but I don't know if it's legit to do so (i.e. having both After=remote-fs.target and Wants=remote-fs.target at the same time).
Anyway in the end, we need a new dependency in user@.service to delay at least until remote-fs.target is reached.
Issue migration from Bugzilla to Jira is in process at this time. This will be the last message in Jira copied from the Bugzilla bug. This BZ has been automatically migrated to the issues.redhat.com Red Hat Issue Tracker. All future work related to this report will be managed there. Due to differences in account names between systems, some fields were not replicated. Be sure to add yourself to Jira issue's "Watchers" field to continue receiving updates and add others to the "Need Info From" field to continue requesting information. To find the migrated issue, look in the "Links" section for a direct link to the new issue location. The issue key will have an icon of 2 footprints next to it, and begin with "RHEL-" followed by an integer. You can also find this issue by visiting https://issues.redhat.com/issues/?jql= and searching the "Bugzilla Bug" field for this BZ's number, e.g. a search like: "Bugzilla Bug" = 1234567 In the event you have trouble locating or viewing this issue, you can file an issue by sending mail to rh-issues. You can also visit https://access.redhat.com/articles/7032570 for general account information. |