Bug 2400220
| Summary: | 'systemd --user' sets PATH with 'sbin' directories on Silverblue | ||
|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | Debarshi Ray <debarshir> |
| Component: | rpm-ostree | Assignee: | Colin Walters <walters> |
| Status: | POST --- | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
| Severity: | medium | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | rawhide | CC: | amurdaca, coreos-sig, daan.j.demeyer, dustymabe, fedoraproject, jmarrero, jonathan, lnykryn, miabbott, msekleta, suraj.ghimire7, systemd-maint, travier, walters, yuwatana, zbyszek |
| Target Milestone: | --- | Flags: | fedora-admin-xmlrpc:
mirror+
|
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | --- | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 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
Debarshi Ray
2025-09-29 20:50:31 UTC
This seems to be an ostree thing. The code in systemd will use $PATH with /usr/sbin and /usr/local/sbin if it sees separate /usr/sbin or /usr/local/sbin. In this case, one of the directories is separate. The user manager ends up with the expected split $PATH. The system manager does not. But when I do 'systemctl daemon-reexec', it gets the split $PATH. So it seems that somehow during boot, the directory does not exist or is not visible. Anyway, the solution is for rpm-ostree to not create the split path, but a symlink for /usr/local/sbin. (In reply to Zbigniew Jędrzejewski-Szmek from comment #1) > This seems to be an ostree thing. Thanks for looking into this, Zbigniew! > The code in systemd will use $PATH with /usr/sbin and /usr/local/sbin if it > sees separate /usr/sbin or /usr/local/sbin. In this case, one of the > directories is separate. > > The user manager ends up with the expected split $PATH. > > The system manager does not. But when I do 'systemctl daemon-reexec', it > gets the split $PATH. So it seems that somehow during boot, the directory > does not exist or is not visible. > > Anyway, the solution is for rpm-ostree to not create the split path, but a > symlink for /usr/local/sbin. Just to be sure that I understood you correctly. Are you saying that systemd will include both /usr/local/sbin and /usr/sbin, if only one of them is a separate directory instead of a symbolic link to its 'bin' counterpart? I am asking because I knew that /usr/local/sbin is not a symlink to /usr/local/bin on Fedora Silverblue, because it handles /usr/local differently, and /usr/sbin is. My original assumption was to treat this as a separate issue, and I was expecting at least /usr/sbin to not be in PATH similar to how /etc/profile behaves. I am not trying to imply that systemd is right or wrong - just trying to be sure that I understood correctly. :) The `/usr/local/sbin` directory is created via https://github.com/coreos/rpm-ostree/blob/main/src/app/rpm-ostree-0-integration.conf#L15 and is stored in `/var` (`/usr/local` points to `/var/usrlocal`). We can replace this entry with a symlink instead but we probably can not find existing systems. > it seems that somehow during boot, the directory does not exist or is not visible. /usr/local is a symlink to /var/usrlocal for Silverblue/CoreOS style appliances where it's intended to support writing content there per-machine. It's created by tmpfiles.d, so yes it won't be there early on boot. > Anyway, the solution is for rpm-ostree to not create the split path, but a symlink for /usr/local/sbin. Symlink to where? I think it's tricky as in the general case here `/var` could be a mount point; when is systemd computing this path? (In reply to Colin Walters from comment #4) > > Anyway, the solution is for rpm-ostree to not create the split path, but a symlink for /usr/local/sbin. > > Symlink to where? I believe it should be something like this: ls -ld /usr/local/sbin lrwxrwxrwx. 1 root root 3 May 16 23:24 /usr/local/sbin -> bin ... to match with the Unify_bin_and_sbin Change: https://fedoraproject.org/wiki/Changes/Unify_bin_and_sbin > Just to be sure that I understood you correctly. Are you saying that systemd will include both /usr/local/sbin and /usr/sbin, if only one of them is a separate directory instead of a symbolic link to its 'bin' counterpart? Yes. (Longer explanation: we do one check, and if any of the conditions are met, we fall into the "split bin-sbin" state. The $PATH value is actually set through a set of parametrized macros, and we just flip between one value or the other.) We can probably change the code to add /usr/sbin and /usr/local/sbin separately to $PATH. This would have the advantage that it'd be more self-explanatory for users. I'll see how complicated it would be to change the code to do that. > lrwxrwxrwx. 1 root root 3 May 16 23:24 /usr/local/sbin -> bin Yes. https://github.com/systemd/systemd/pull/39275 will make the $PATH handle merged-usr-sbin and split-usr-local-sbin. (In reply to Zbigniew Jędrzejewski-Szmek from comment #7) > https://github.com/systemd/systemd/pull/39275 will make the $PATH handle > merged-usr-sbin and split-usr-local-sbin. Thanks, Zbigniew! Note to myself: I should have stopped to think that STRV_FOREACH_PAIR in default_PATH() is a loop - no idea why I missed that. :) (In reply to Timothée Ravier from comment #3) > The `/usr/local/sbin` directory is created via > https://github.com/coreos/rpm-ostree/blob/main/src/app/rpm-ostree-0- > integration.conf#L15 and is stored in `/var` (`/usr/local` points to > `/var/usrlocal`). > > We can replace this entry with a symlink instead but we probably can not > find existing systems. I tried to put together a pull request to update rpm-ostree: https://github.com/coreos/rpm-ostree/pull/5507 This message is a reminder that Fedora Linux 42 is nearing its end of life. Fedora will stop maintaining and issuing updates for Fedora Linux 42 on 2026-05-13. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as EOL if it remains open with a 'version' of '42'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, change the 'version' to a later Fedora Linux version. Note that the version field may be hidden. Click the "Show advanced fields" button if you do not see it. Thank you for reporting this issue and we are sorry that we were not able to fix it before Fedora Linux 42 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora Linux, you are encouraged to change the 'version' to a later version prior to this bug being closed. |