-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
systemd: Use sysusers.d to create ws users #18112
Conversation
The arch failure is straightforward, already fixed/verified locally. The two coreos failures are more serious: "error: While applying overrides for pkg cockpit-ws: Could not find group 'cockpit-wsinstance' in group file". It seems I moved it from This should also fix all the TF failures which use a fresh install instead of an upgrade. Nice to cover that case cleanly as well! |
TF failures are still significant:
That's because
Investigating in a prepared fedora-37 VM:
But:
This failure is an independent flake, I'll add a piggy-back commit here. |
See also #16811 |
@allisonkarlitskaya : Yes, I'm aware of this, I mentioned it in the description already. But I don't think this will make progress anytime soon. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good assuming everything passes. One comment for your consideration.
@@ -48,6 +51,7 @@ src/systemd/%: src/systemd/%.in | |||
systemdgenerated = \ | |||
$(nodist_systemdunit_DATA) \ | |||
$(nodist_tempconf_DATA) \ | |||
$(nodist_sysusers_DATA) \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd lean towards doing that in configure.ac
. The only reason we need to do these ones here is to get the recursive path expansion (see the comment just above), but that's not an issue for these files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was actually vaguely aware of this, but I found it nice to keep all the systemd bits together in one file. I don't have a strong opinion about it, though.
I totally agree. We're basically waiting on support in systemd which nobody seems to be interested in working on. I have no intention to block this PR in the meantime. |
Hmm, the two IPA tests fail a little too often for my taste on R8.8 and C8S. A lot of it is noise due to the "3x affected" retries, but apparently not these. They reproduce well locally, I'll investigate them tomorrow. Curiously these tests aren't even affected by the sysusers changes -- the packages are upgraded, and it's still exactly the same
There should be a /etc/cockpit/ws-certs.d/10-ipa.cert, but isn't. And lo and behold:
With Tests pass again when I drop the Seems the RPM macro is broken:
|
could this be caused by a conflict with the existing users that we get from installing the package in the base image? in a certain sense we're not really properly testing the creation of new users here... |
@allisonkarlitskaya : We test three cases now:
|
On a busy CI machine this can easily take more than a minute, which causes test flakes. Increase the timeout to 3 minutes.
`dh_install --fail-missing` has been deprecated for a while and got removed in dh compat level 12 (which we use). Use `dh_missing` instead. We can drop the override once we move to dh compat level 13. This fixes the warning during build: dh_install: warning: Please use dh_missing --list-missing/--fail-missing instead dh_install: warning: This feature will be removed in compat 12.
Move to using systemd's sysusers declarative files [1] for creating our system users/groups. Arch already does that, Fedora moved to it since Fedora 32 [2], and Debian supports it as well [3]. In debian/cockpit-ws.postinst, move the `#DEBHELPER#` block above the statoverride, as the former now generates the user, and the latter needs it. Unfortunately Fedora/rpm's `%attr` does not really work with sysusers files shipped upstream yet. The conf files are not installed yet during `%pre`, but creating the users in `%post` is too late for the file unpack phase, so cockpit-session would get the wrong permissions. Thus duplicate the two sysusers config lines verbatim in `%pre`, which is at least marginally better than calling `useradd` etc. programmatically. Extend TestConnection.testWsPackage to remove the system users, reboot, and validate that cockpit still works. This ensures correct sysusers.d packaging across all distributions, as our normal CI images already have the system users. Fixes cockpit-project#15027 [1] https://www.freedesktop.org/software/systemd/man/sysusers.d.html [2] https://fedoraproject.org/wiki/Changes/Adopting_sysusers.d_format [3] https://manpages.debian.org/dh_installsysusers
LOL 🤣 The reason was that the macro is broken in RHEL 8 (see edited comment above), and thus the remainder of |
I think the trouble we're seeing here is maybe a fundamental incompatibility between sysusers and having non-root-owned files installed by the package. If the user gets deleted and later recreated, the uid on the filesystem might not be the same as the uid of the new user... |
Ack, indeed. So let's shelve this and reconsider after #16808 -- if that ever lands, that would unblock the sysusers approach. Thanks for catching! |
This is still very far out, and I don't want to stare at this on my /pulls page for that long. I sent the Debian packaging fix to #18339, and will close this one for now. |
Move to using systemd's sysusers declarative files [1] for creating our
system users/groups. Arch already does that, Fedora moved to it since
Fedora 32 [2], and Debian supports it as well [3].
In debian/cockpit-ws.postinst, move the
#DEBHELPER#
block above thestatoverride, as the former now generates the user, and the latter needs
it.
Unfortunately Fedora/rpm's
%attr
does not really work with sysusersfiles shipped upstream yet. The conf files are not installed yet during
%pre
, but creating the users in%post
is too late for the fileunpack phase, so cockpit-session would get the wrong permissions. Thus
duplicate the two sysusers config lines verbatim in
%pre
, which is atleast marginally better than calling
useradd
etc. programmatically.Extend TestConnection.testWsPackage to remove the system users, reboot,
and validate that cockpit still works. This ensures correct sysusers.d
packaging across all distributions, as our normal CI images already have
the system users.
Fixes #15027
[1] https://www.freedesktop.org/software/systemd/man/sysusers.d.html
[2] https://fedoraproject.org/wiki/Changes/Adopting_sysusers.d_format
[3] https://manpages.debian.org/dh_installsysusers
We originally tried
DynamicUser=
in #16811, but that has been blocked for too long. IMHO this is a nice improvement already, and does not block moving to DynamicUser= in the future.