Hi Chris, hi Elbrus, hi Roland,

On  Do 12 Nov 2026 16:50:59 CET, Roland Clobus wrote:

[...]

There has some discussion been going on due to testing migration failures of src:pkg debian-edu package because of problems like:

```
363s Creating group 'kvm' with GID 982.
363s Creating group 'render' with GID 981.
363s /usr/lib/tmpfiles.d/static-nodes-permissions.conf:18: Failed to resolve group 'kvm': Unknown group 363s /usr/lib/tmpfiles.d/static-nodes-permissions.conf:19: Failed to resolve group 'kvm': Unknown group 363s /usr/lib/tmpfiles.d/static-nodes-permissions.conf:20: Failed to resolve group 'kvm': Unknown group
```

I would like to bring up some findings Roland Clobus and I had that might be relevant.

TL;DR; does a package that uses the sysusers.d API of systemd need a Pre-Depends: on libnss-systemd???

The failures we observed in CI (with debian-edu << 2.13.8, the current version has another breakage):

  - a postinst script of some package uses sysusers.d API from systemd to
    create a system user or group
  - and then later on in that postinst script, it tries to operate on that
    user or group (normally a chown on some folder or file)
  - we often then get an error message from that operation like the one
    quoted above, because the user (or group) that just got created does
    not yet exist on the system (or rather: it cannot yet be seen by the
    system).

A parallel observation we had is this:

  - package X configures a new user/group via sysusers.d API from systemd
  - package X want to use this user/group immediately (and fails)
  - further down in the output of APT (Configuring <package>...), we can
    see that libnss-systemd gets configured.
  - libnss-systemd uses dh-nss and ships debian/libnss-systemd.nss. dh-nss
    adds various #DEBHELPER# snippets to all (iirc) package scripts to
    manage "systemd" nss provider info to the entries user, group, shadow,
    gshadow in nsswitch.conf

The problem now is:

  - package X wants to operate on a user/group visible to the system
    via libnss-systemd
  - but: libnss-systemd is not yet configured (postinst)
  - that means: "systemd" entries are not yet in /etc/nsswitch.conf for
    user, group, shadow, gshadow when package X wants to use them
  - which means: the user/group is still invisible when package X wants
    to operate on them

Boom! Should this be discussed with a broader audience???

Happy about feedback!
Mike
--

mike gabriel aka sunweaver (Debian Developer)
mobile: +49 (1520) 1976 148
landline: +49 (4351) 486 14 27

GnuPG Fingerprint: 9BFB AEE8 6C0A A5FF BF22  0782 9AF4 6B30 2577 1B31
mail: [email protected], http://sunweavers.net

Attachment: pgpw3w2XIT8Qh.pgp
Description: Digitale PGP-Signatur

Reply via email to