[Rpm-maint] [rpm-software-management/rpm] Add a man page for rpm sysusers integration (PR #4126)

Panu Matilainen notifications at github.com
Mon Mar 9 12:05:24 UTC 2026


@pmatilai commented on this pull request.



> +
+- Suffix *u* with an exclamation mark (*!*) to create a fully locked account
+  (recommended)
+- Use a dash (*-*) as _UID_/_GID_ for automatic number allocation (recommended)
+- _FILE_ is an absolute path to a file whose UID/GID should be used
+- _LINE_ uses *Line format* with the fields passed as macro arguments
+
+# DESCRIPTION
+
+RPM has native support for declarative user and group creation by integrating
+with the *sysusers.d*(5) format (introduced by systemd). Packagers only need to
+drop one or more files to _/usr/lib/sysusers.d/_ and RPM will handle the rest,
+such as dependency generation and the invocation of *systemd-sysusers*(8) during
+the build and installation, respectively.
+
+Vendors on non-systemd platforms can enable the feature by shipping any missing

I had a feeling I must be forgetting something here, and I was: the %add_sysuser macro is actually used by the dependency generator as well, only it uses the -b(are) option to emit only the dependency without the Provides: tag for such use. And I think there was somebody else (Python stuff I think) using it that way for their own purposes that way as well, which is fine of course.

After dusting my memory a bit: the technical reason why %add_sysuser from the spec is not recommended with native systemd is that they are package-level provides whereas the automatically generated ones are file-level provides, and this actually makes a difference for native systemd (this relates to the --replace option). I don't know why I didn't write that down in the doc, but I think we should, because it makes it way clearer: using it to is *not fully compatible* with native systemd.

IIRC it just seemed necessary to have *some* way to manually generate those entries from a spec, but besides the technical bits, it's just godforsaken ugly in a spec :laughing: 

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/4126#discussion_r2905013257
You are receiving this because you are subscribed to this thread.

Message ID: <rpm-software-management/rpm/pull/4126/review/3914947625 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20260309/4c8d8b52/attachment.htm>


More information about the Rpm-maint mailing list