Bug#786970: [dh-systemd] dh-systemd leaves dangling symlinks after dpkg purge and remove

Wolfgang Silbermayr ws at xell.at
Wed May 27 10:49:07 BST 2015


Package: dh-systemd
Version: 1.22
Severity: normal

--- Please enter the report below this line. ---

I have a package which contains the following debian/<package>.service
file and uses dh-systemd:

> [Unit]
> Description=Package description
> 
> [Service]
> Type=oneshot
> ExecStart=/usr/lib/<package>/bin/some-tool
> 
> [Install]
> WantedBy=multi-user.target

When installing the package, then purging and removing it using dpkg, a
dangling symlink is left on the system:

/etc/systemd/system/multi-user.target.wants/<package>.service ->
/lib/systemd/system/<package>.service

A snippet like this should basically do the work (similar to what can be
found in lxdm 0.5.1-1 postrm in current unstable):

> # Test if /etc/systemd/system/<package>.service is broken now
> SERVICE_FILE=/etc/systemd/system/<service>.service
> if [ -L $SERVICE_FILE ] && [ ! -e $SERVICE_FILE ]; then
>   echo "WARN: clearing dangling symlink $SERVICE_FILE" >&2
>   rm -f $SERVICE_FILE
> fi

--- System information. ---
Architecture: amd64
Kernel:       Linux 3.16.0-4-amd64

Debian Release: 8.0
  500 stable-updates  ftp.cz.debian.org
  500 stable          security.debian.org
  500 stable          ftp.cz.debian.org
  100 jessie-backports ftp.cz.debian.org

--- Package information. ---
Package's Depends field is empty.

Package's Recommends field is empty.

Package's Suggests field is empty.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://lists.alioth.debian.org/pipermail/pkg-systemd-maintainers/attachments/20150527/41e68d03/attachment.sig>


More information about the Pkg-systemd-maintainers mailing list