Package: debhelper
Version: 13
Severity: important

Hi,

for switching wdm to compat level 13 I changed debian/rules as follows:

Before with dh 11:
------------------------------------------------------------------------
override_dh_installinit:
        dh_installinit --noscripts
------------------------------------------------------------------------

After with dh 13:

------------------------------------------------------------------------
override_dh_installinit:
        dh_installinit --noscripts

override_dh_installsystemd:
        dh_installsystemd --no-restart-on-upgrade
------------------------------------------------------------------------

Upon package upgrade, wdm is nevertheless restarted and the currently
running X session is gone.

With a lot of experimenting (e.g. trying the alias --no-stop-on-upgrade
for --no-restart-on-upgrade), I figured out that this works as I want
it:

------------------------------------------------------------------------
override_dh_installinit:
        dh_installinit --noscripts

override_dh_installsystemd:
        dh_installsystemd --no-restart-on-upgrade --no-restart-after-upgrade
------------------------------------------------------------------------

But the dh_installsystemd(1) man pageIMHO doesn't explain this
behaviour:

------------------------------------------------------------------------
       --restart-after-upgrade
           Do not stop the unit file until after the package upgrade has
           been completed.  This is the default behaviour in compat 10.

           In earlier compat levels the default was to stop the unit
           file in the prerm, and start it again in the postinst.

           This can be useful for daemons that should not have a
           possibly long downtime during upgrade. But you should make
           sure that the daemon will not get confused by the package
           being upgraded while it's running before using this option.

       --no-restart-after-upgrade

           Undo a previous --restart-after-upgrade (or the default of
           compat 10).  If no other options are given, this will cause
           the service to be stopped in the prerm script and started
           again in the postinst script.

       -r, --no-stop-on-upgrade, --no-restart-on-upgrade
           Do not stop service on upgrade.
------------------------------------------------------------------------

"Do not stop service on upgrade." is clearly not true unless additional
options are given.

"Undo a previous --restart-after-upgrade (or the default of compat 10)."
is not true either there was no previous --restart-after-upgrade to
undo.

I suspect that either

* the logic which adds the snippets to postinst is flawed,
* the snippets added to postinst are flawed, or
* it's a pure documentation issue.

-- System Information:
Debian Release: bullseye/sid
  APT prefers unstable
  APT policy: (990, 'unstable'), (600, 'testing'), (500, 'unstable-debug'), 
(500, 'buildd-unstable'), (110, 'experimental'), (1, 'experimental-debug'), (1, 
'buildd-experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 5.5.0-1-amd64 (SMP w/4 CPU cores)
Kernel taint flags: TAINT_FIRMWARE_WORKAROUND, TAINT_UNSIGNED_MODULE
Locale: LANG=C.UTF-8, LC_CTYPE=C.UTF-8 (charmap=UTF-8), LANGUAGE=C.UTF-8 
(charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: sysvinit (via /sbin/init)
LSM: AppArmor: enabled

Versions of packages debhelper depends on:
ii  autotools-dev            20180224.1
ii  dh-autoreconf            19
ii  dh-strip-nondeterminism  1.8.0-1
ii  dpkg                     1.19.7
ii  dpkg-dev                 1.19.7
ii  dwz                      0.13-5
ii  file                     1:5.38-4
ii  libdebhelper-perl        13
ii  libdpkg-perl             1.19.7
ii  man-db                   2.9.1-1
ii  perl                     5.30.0-10
ii  po-debconf               1.0.21

debhelper recommends no packages.

Versions of packages debhelper suggests:
ii  dh-make  2.202001

-- no debconf information

Reply via email to