Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 549360 - user.eclass: support 'sysusers.d'
Summary: user.eclass: support 'sysusers.d'
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo's Team for Core System packages
Depends on: glep27
  Show dependency tree
Reported: 2015-05-13 09:11 UTC by Elias Probst
Modified: 2021-02-08 12:19 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Note You need to log in before you can comment on or make changes to this bug.
Description Elias Probst 2015-05-13 09:11:50 UTC
I'd like to see support for systemd's "sysusers.d" [1] in user.eclass.

This would allow straightforward user creation in stateless systems [2] which are built using Gentoo/binpkgs.

This would basically just mean, that 'enew{user,group}' would drop a per-package file into /usr/lib/sysusers.d/, e.g.

u apache 81 "Apache httpd" /var/www

Comment 1 Mike Gilbert gentoo-dev 2015-05-13 16:13:54 UTC
That's an interesting idea.

The first question that comes to mind would be how to handle the id assignment. We seem to have a few options. From the manual:

> For u and g the numeric 32bit UID or GID of the user/group. Do not use IDs 65535 or 4294967295, as they have special placeholder meanings. Specify "-" for automatic UID/GID allocation for the user or group. Alternatively, specify an absolute path in the file system. In this case the UID/GID is read from the path's owner/group. This is useful to create users whose UID/GID match the owners of pre-existing files (such as SUID or SGID binaries).

In summary:

- Specify a number for a static uid/gid.
- Specify a hyphen for a random uid/gid.
- Specify a path to grab the uid/gid from an existing file.