Bug#944478: suboptimal handling of tmpfiles if dh_installsystemd is called multiple times
Michael Biebl
biebl at debian.org
Sun Nov 10 16:48:03 GMT 2019
Package: debhelper
Version: 12.7.1
Severity: normal
Hi,
I'm currently working on updating the debhelper compat level in systemd
from 10 to 12:
https://salsa.debian.org/systemd-team/systemd/commits/wip/compat-12
systemd ships several units files, which are currently enabled manually
in the maintainers scripts.
systemd also ships several tmpfiles, which are currenly enabled via
dh_installinit.
With compat level 12 and dh_installsystemd, tmpfiles are no longer
handled by dh_installinit.
Since I need to call dh_installsystemd several times (with different
argument), the following code is currently added multiple times as well:
if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then
# In case this system is running systemd, we need to ensure that all
# necessary tmpfiles (if any) are created before starting.
if [ -d /run/systemd/system ] ; then
systemd-tmpfiles --create debian.conf home.conf journal-nocow.conf legacy.conf systemd-nologin.conf systemd.conf tmp.conf var.conf x11.conf >/dev/null || true
fi
fi
https://salsa.debian.org/systemd-team/systemd/commit/25bbc8de507f2f9317149eb1f152e899e77776a1
This is not really great.
Somehow I think it would the cleanest solution if tmpfiles handling was
split into a separate helper, say dh_installtmpfile which can be called
individually from dh_installsystemd.
Technically this would make sense, as a tmpfile is strictly speaking no
unit file. We would leave handling of unit files solely to
dh_installsystemd.
Only issue would be, that we need to get the ordering right, but I think
it would be sufficient if we always call dh_installtmpfile before
dh_installsystemd (at least I can't think of a reason why we ever need
to run it after dh_installsystemd).
Comments most welcome.
Maybe there is different solution to fix this directly in
dh_installsystemd which I'm not seeing.
Regards,
Michael
-- System Information:
Debian Release: bullseye/sid
APT prefers unstable
APT policy: (500, 'unstable'), (200, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386
Kernel: Linux 5.3.0-2-amd64 (SMP w/4 CPU cores)
Kernel taint flags: TAINT_WARN
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8), LANGUAGE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled
Versions of packages debhelper depends on:
ii autotools-dev 20180224.1
ii dh-autoreconf 19
ii dh-strip-nondeterminism 1.6.2-1
ii dpkg 1.19.7
ii dpkg-dev 1.19.7
ii dwz 0.13-2
ii file 1:5.37-6
ii libdebhelper-perl 12.7.1
ii libdpkg-perl 1.19.7
ii man-db 2.9.0-1
ii perl 5.30.0-9
ii po-debconf 1.0.21
debhelper recommends no packages.
Versions of packages debhelper suggests:
ii dh-make 2.201902
-- no debconf information
More information about the Pkg-systemd-maintainers
mailing list