tmpfiles config is only installed with systemd_files enabled; should be independent
I appreciate that libsystemd use and installing systemd_files are decoupled in this project.
However, the systemd/tmpfiles.d/knot-resolver.conf.in
tmpfiles config only gets processed / installed if systemd_files is enabled when building.
There are distros which have a working tmpfiles provider but do not use systemd as the init system.
Enabling systemd_files is not the correct solution, as this also installs the other systemd files which is not desired on systems which do not actually use systemd as the init system.
Therefore, the coupling of tmpfiles support to systemd_files is incorrect.
In Gentoo, the systemd-tmpfiles
binary is provided by the sys-apps/systemd-utils
package.
$ equery b $(which systemd-tmpfiles)
* Searching for /bin/systemd-tmpfiles ...
sys-apps/systemd-utils-254.8 (/bin/systemd-tmpfiles)
$ eix sys-apps/systemd-utils
[I] sys-apps/systemd-utils
Available versions: 254.5-r2^t 254.7^t (~)254.8^t {+acl boot kernel-install +kmod secureboot selinux split-usr sysusers test +tmpfiles +udev ukify ABI_MIPS="n32 n64 o32" ABI_S390="32 64" ABI_X86="32 64 x32" PYTHON_SINGLE_TARGET="python3_10 python3_11 python3_12"}
Installed versions: 254.8^t(05:00:50 25.12.2023)(kmod split-usr tmpfiles udev -acl -boot -kernel-install -secureboot -selinux -sysusers -test -ukify ABI_MIPS="-n32 -n64 -o32" ABI_S390="-32 -64" ABI_X86="64 -32 -x32" PYTHON_SINGLE_TARGET="python3_11 -python3_10 -python3_12")
Homepage: https://systemd.io/
Description: Utilities split out from systemd for OpenRC users
This package is depended upon by a few other crucial bits and it is therefore always installed on a Gentoo OpenRC system.
$ equery d systemd-utils
* These packages depend on systemd-utils:
virtual/libudev-251-r2 (!systemd ? >=sys-apps/systemd-utils-251[udev,abi_x86_32(-)?,abi_x86_64(-)?,abi_x86_x32(-)?,abi_mips_n32(-)?,abi_mips_n64(-)?,abi_mips_o32(-)?,abi_s390_32(-)?,abi_s390_64(-)?])
virtual/tmpfiles-0-r5 (!systemd ? sys-apps/systemd-utils[tmpfiles])
virtual/udev-217-r7 (!systemd ? sys-apps/systemd-utils[udev])
I suspect Alpine and other non-systemd distros also run into this.
I do not think this is a distro issue since the underlying assumption of the build scripts that a full systemd installation is the only possible tmpfiles provider does not hold true.
In this case we do not need the unit or other files for systemd since the init system is OpenRC but we do support and would like to have the tmpfiles config.
So ideally these should be decoupled from each other with enabling systemd_files also enabling the tmpfiles config but enabling tmpfiles being available independently of enabling systemd_files.
I am happy to submit a patch if there is consensus that this is the correct approach.