Re: Bug#944478: suboptimal handling of tmpfiles if dh_installsystemd is called multiple times

2019-11-10 Thread Michael Biebl
Am 10.11.19 um 17:48 schrieb Michael Biebl:
> 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


I renamed that branch to
https://salsa.debian.org/systemd-team/systemd/commits/biebl/compat-12


-- 
Why is it that all of the instruments seeking intelligent life in the
universe are pointed away from Earth?



signature.asc
Description: OpenPGP digital signature


Re: Bug#944478: suboptimal handling of tmpfiles if dh_installsystemd is called multiple times

2019-11-10 Thread Michael Biebl
Am 10.11.19 um 17:48 schrieb Michael Biebl:
> 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).

In addition to that, we currently do add the tmpfiles maintainer scripts
code unconditionally, without a possibility to tweak its behaviour.

The only wait to avoid the creation is to add an empty override like this:

override_dh_installsystemd:




-- 
Why is it that all of the instruments seeking intelligent life in the
universe are pointed away from Earth?



signature.asc
Description: OpenPGP digital signature


Bug#944478: suboptimal handling of tmpfiles if dh_installsystemd is called multiple times

2019-11-10 Thread Michael Biebl
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/25bbc8de507f2f9317149eb1f152e899e6a1


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-dev20180224.1
ii  dh-autoreconf19
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-perl12.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