Skip to content
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

Closed
wants to merge 3 commits into from

Commits on Jan 4, 2023

  1. test: Increase kdump wait timeout

    On a busy CI machine this can easily take more than a minute, which
    causes test flakes. Increase the timeout to 3 minutes.
    martinpitt committed Jan 4, 2023
    Configuration menu
    Copy the full SHA
    10b1715 View commit details
    Browse the repository at this point in the history
  2. tools: Bring back missing files check in Debian packaging

    `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.
    martinpitt committed Jan 4, 2023
    Configuration menu
    Copy the full SHA
    72a0f01 View commit details
    Browse the repository at this point in the history
  3. systemd: Use sysusers.d to create ws users

    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
    martinpitt committed Jan 4, 2023
    Configuration menu
    Copy the full SHA
    b61f854 View commit details
    Browse the repository at this point in the history