Skip to content

Conversation

@bluca
Copy link

@bluca bluca commented Oct 19, 2025

sysusers.d config files allows a package to use declarative configuration instead of manually written maintainer scripts.
The distro/common/knot.service unit file uses User=knot and Group=knot so the user/group need to be created before it can be started, and this takes care of it automatically.
This also allows image-based systems to be created with /usr/ only, and also allows for factory resetting a system and recreating /etc/ on boot.

https://www.freedesktop.org/software/systemd/man/latest/sysusers.d.html

sysusers.d config files allows a package to use declarative configuration
instead of manually written maintainer scripts.
The distro/common/knot.service unit file uses User=knot and Group=knot
so the user/group need to be created before it can be started, and this
takes care of it automatically.
This also allows image-based systems to be created with /usr/ only, and
also allows for factory resetting a system and recreating /etc/ on boot.

https://www.freedesktop.org/software/systemd/man/latest/sysusers.d.html
@salzmdan
Copy link
Member

Thanks! I will take a look. It must work with all the distributions that we support.

@bluca
Copy link
Author

bluca commented Oct 20, 2025

Thanks! Yeah it's paired with the systemd unit file, so it will work on all distros where that one works (and probably more, there's an independent sysusers.d reimplementation as well in some places)

@salzmdan
Copy link
Member

@bluca
Copy link
Author

bluca commented Oct 20, 2025

Thanks for looking into it, my idea here was to provide only something very basic, but if you are looking for a more complete integration, please check what I have sent as a MR for the debian package: https://salsa.debian.org/dns-team/knot-dns/-/merge_requests/14

@salzmdan
Copy link
Member

Nice. We try to synchronize the salsa packaging and our distro packaging.
I think you should create a group knot as well (if I understand the syntax correctly). It's very convenient.

@bluca
Copy link
Author

bluca commented Oct 20, 2025

Yeah the sysusers u entry creates both a user and a group by default so that should be covered

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants