zabbly / incus

Incus package repository
176 stars 14 forks source link

systemd: include incus.sysusers #17

Closed Foxboron closed 6 months ago

Foxboron commented 7 months ago

This file enables the creation of all incus groups and users during package installation without the need for programatic post install scripts.

Signed-off-by: Morten Linderud morten@linderud.pw

stgraber commented 7 months ago

Ah, never looked at systemd-sysusers. Going to have to do some testing to make sure it works properly on the older distros (Debian 11 / Ubuntu 20.04). If that works as expected, I'll merge that and remove the shell logic, I think it will need a small tweak to the workflow too to put the file in the right spot.

stgraber commented 7 months ago

I suspect it's not widely used in Debian mostly because they still support non-systemd init systems which would possibly be a problem here, but I also didn't find anything in the Debian packaging policies that specifically says not to use systemd-sysusers.

@freeekanayaka are you aware of anything on the Debian front?

Foxboron commented 7 months ago

In Arch we have largely removed all of the post-install hooks creating directories or users in favour of sysusers.d and tmpfiles.d.

https://man.archlinux.org/man/core/systemd/sysusers.d.5.en

https://man.archlinux.org/man/core/systemd/tmpfiles.d.5.en

Foxboron commented 7 months ago

Mainly I'm including it here for reference so people can see what users and groups are needed, instead of reading the documentation or the debian packaging :)

freeekanayaka commented 7 months ago

I suspect it's not widely used in Debian mostly because they still support non-systemd init systems which would possibly be a problem here, but I also didn't find anything in the Debian packaging policies that specifically says not to use systemd-sysusers.

@freeekanayaka are you aware of anything on the Debian front?

Non-systemd init systems are supported on a best-effort basis, so I believe that it should be fine to use systemd-sysusers. However I'll need to double check this.

freeekanayaka commented 7 months ago

You should be able to use dh_installsysusers by moving the systemd/incus.sysusers file in this PR directly to debian/incus.sysusers.

Although probably there aren't many packages using this, it should be perfectly policy-compliant.