forked from Gardenhouse/gardenerdb
Drop-in standalone implementation of systemd-userdb
- C 96.5%
- Meson 3%
- Shell 0.5%
This is stupid. I hate that I have to add this. But because I guess this is now a part of the userdb records we have this field now. This field will never be properly populated by GardenerDB, it will always be set to 1998-07-06 (airing date of lain in japan) |
||
|---|---|---|
| examples | ||
| include | ||
| lib | ||
| nss | ||
| src | ||
| subprojects | ||
| test | ||
| units | ||
| varlink | ||
| .gitignore | ||
| COPYING | ||
| meson.build | ||
| meson_options.txt | ||
| README.md | ||
gardenerDB
Drop-in standalone implementation of systemds userdb.
Components
| Binary | Description |
|---|---|
gardenerdb-mux |
Multiplexer daemon. Listens on io.systemd.Multiplexer |
gardenerdb-dynamic |
Dynamic user daemon. Allocates ephermal UIDs/GIDs on demand io.systemd.DynamicUser + io.gardenerdb.DynamicUser |
gardenerdbctl |
CLI tool to query users/groups/memberships. Equivalent to userdbctl |
libnss_gardenerdb.so |
NSS module, makes gardenerDB provides users/groups available to getpwnam(), getgrnam() and similiar |
gardenerdb-dynamicctl |
Tool to allocate/release dynamic users |
Building
Requires vali, json-c and meson >= 0.60
meson setup build
meson compile -C build
meson test -C build
meson install -C build
All dependencies may be automatically pulled as meson subprojects if they are not installed system-wide.
Build options
| Option | Default | Description |
|---|---|---|
dynamic-uid-min |
61184 | First UID in the dynamic allocation pool |
dynamic-uid-max |
65519 | Last UID in the dynamic allocation pool |
init-system |
openrc |
Init system to install service files for: systemd, openrc, s6, runit or none |
meson setup build -Dinit-system=s6 -Ddynamic-uid-min=60000
Using dynamic users in services
The examples/ directory contains examples on how to use dynamic users in openrc, runit and s6.
The concept for all of them is pretty much the same:
- Generate the username based on the service name
- Get the uid/gid from gardenerdb-dynamicctl allocate
- Execute the program as the newly created user
- After the program exits, call gardenerdb-dynamicctl release with the previously generated username