Bug#964159: /usr/bin/deb-systemd-helper: Makes packages using dh_installsystemduser(1) fail piuparts

guilhem at debian.org guilhem at debian.org
Thu Jul 2 20:05:26 BST 2020


Package: init-system-helpers
Version: 1.57
Severity: normal
File: /usr/bin/deb-systemd-helper
Tags: patch

Dear Maintainer,

dh_installsystemduser/13.1 adds the following snippets to postrm scripts:

--8<---------------------------------------------------------------------->8--
# Automatically added by dh_installsystemduser/13.1
if [ "$1" = "remove" ]; then
    if [ -x "/usr/bin/deb-systemd-helper" ] ; then
        deb-systemd-helper --user mask 'NAME.service' >/dev/null || true
    fi
fi

if [ "$1" = "purge" ]; then
    if [ -x "/usr/bin/deb-systemd-helper" ] ; then
        deb-systemd-helper --user purge 'NAME.service' >/dev/null || true
        deb-systemd-helper --user unmask 'NAME.service' >/dev/null || true
    fi
fi
# End automatically added section
--8<---------------------------------------------------------------------->8--

So `postrm remove` creates a symlink ‘/etc/systemd/user/NAME.service → /dev/null’
plus an empty file ‘/var/lib/systemd/deb-systemd-user-helper-masked/NAME.service’.
`postrm purge` removes these but not the parents directories, hence causes
`piuparts -d sid --no-upgrade-test` to fail with

    ERROR: FAIL: Package purging left files on system:
      /etc/systemd/user/         not owned
      /var/lib/systemd/deb-systemd-user-helper-masked/   not owned

The attached patch fixes this.  I mirrored what was done for /etc/systemd/system
resp. /var/lib/systemd/deb-systemd-helper-masked, namely claiming ownership for
/etc/systemd/user and removing /var/lib/systemd/deb-systemd-user-helper-masked
if empty.

-- System Information:
Debian Release: bullseye/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 5.7.0-1-amd64 (SMP w/8 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE=en_US:en (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages init-system-helpers depends on:
ii  perl-base  5.30.3-4

init-system-helpers recommends no packages.

init-system-helpers suggests no packages.

Versions of packages init-system-helpers is related to:
ii  insserv  1.21.0-1

-- no debconf information

-- 
Guilhem.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Ensure-dh_installsystemduser-1-added-snippets-pass-p.patch
Type: text/x-diff
Size: 1830 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/pkg-systemd-maintainers/attachments/20200702/7510c35b/attachment.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/pkg-systemd-maintainers/attachments/20200702/7510c35b/attachment.sig>


More information about the Pkg-systemd-maintainers mailing list