Start sysext.service in initramfs too#39410
Conversation
|
Sorry, but this seems very wrong. First of all, systemctl reload systemd-sysext.service and stop must operate on the real root and not assume the service always executes in initrd context. Please add a new systemd-sysext-sysroot.service for this purpose. Secondly, we discussed this again in systemd chat. My thinking is that systemd-sysext-sysroot.service should be configurable via initrd preset, and instead of changing fstab-generator the unit can just carry WantsMountsFor=/var/lib/sysexts. That way the mount is established in initrd only if the user is using sysext. In particular, each level of /var/lib/sysexts/ might be a separate mount, hence your patch here is not comprehensive. |
That's why it's in a draft ;) Yes I can do a separate unit, and we can keep sysext.service but then what would be the difference with sysext-sysroot? Especially if they are both enabled, what would bring the second? Also as I pointed in the issue, how are we going to disable sysext-sysroot without rebuilding the initramfs? Either a config or a file to be checked? |
5fc6593 to
05d3260
Compare
05d3260 to
9888b68
Compare
9888b68 to
4257401
Compare
4257401 to
aec776b
Compare
Introduce systemd-sysext-sysroot.service to run in initramfs, meaning the service still looks for units in /sysroot but it does it before switch-root. Because units are usually in /var/lib/extensions, add also a wants dependency on that, to be sure it is mounted accordingly. Same applies for confext
aec776b to
520f02e
Compare
|
Thanks for working on this. I've had the same goal and opened a couple of PRs to fix blocker issues mainly due to broken |
| Documentation=man:systemd-confext-sysroot.service(8) | ||
|
|
||
| ConditionCapability=CAP_SYS_ADMIN | ||
| ConditionDirectoryNotEmpty=|/sysroot/var/lib/confexts |
There was a problem hiding this comment.
Also to consider: mutable extensions
systemd-confext (and sysext) support an automatic mutability mode, where a mutable extension is placed in /var/lib/extensions.mutable and then confext will mount it over /etc. This patch doesn't seem to account for that
| AssertPathExists=/etc/initrd-release | ||
|
|
||
| DefaultDependencies=no | ||
| After=sysroot.mount sysroot-usr.mount initrd-root-fs.target initrd-parse-etc.service |
There was a problem hiding this comment.
You run this after initrd-parse-etc but it should probably happen before? Given that the confext merging changes the contents of /etc?
There was a problem hiding this comment.
CC @YHNdnzj you seem to be the person that suggested this run after initrd-parse-etc. But that really doesn't make sense, since /etc/fstab is going to be handled via a confext on systems that use a mutable confext to manage /etc
Trying to parse /etc/fstab before you setup the confext isn't going to work because there isn't going to be an /etc/fstab to parse.
|
Let's close this one and continue in #41161 |
More context explained here: #38985