#832351 xdm: purging leaves leaves dangling /etc/systemd/system/display-manager.service symlink

Package:
xdm
Source:
xdm
Description:
X display manager
Submitter:
Andreas Beckmann
Date:
2018-12-15 13:33:02 UTC
Severity:
important
#832351#5
Date:
2016-07-24 13:49:32 UTC
From:
To:
Hi,

during tests with piuparts I noticed the same behavior in 4 packages
providing a display-manager service: a dangling symlink is left after
purge. Some have individual bugs filed (lightdm: #775385, gdm3:
#771085), but this is more likely a bug somewhere in the helpers being
used. Notice, that after purge no other package providing a
display-manager service was installed any more.


1m16.3s ERROR: FAIL: Package purging left files on system:
  /etc/systemd/system/display-manager.service -> /lib/systemd/system/xdm.service	 not owned

3m8.3s ERROR: FAIL: Package purging left files on system:
  /etc/systemd/system/display-manager.service -> /lib/systemd/system/sddm.service	 not owned

2m46.0s ERROR: FAIL: Package purging left files on system:
  /etc/systemd/system/display-manager.service -> /lib/systemd/system/gdm3.service	 not owned

1m23.3s ERROR: FAIL: Package purging left files on system:
  /etc/systemd/system/display-manager.service -> /lib/systemd/system/lightdm.service	 not owned


Andreas

#832351#16
Date:
2016-07-24 13:54:55 UTC
From:
To:
Am 24.07.2016 um 15:49 schrieb Andreas Beckmann:

Those links are not created by init-system-helpers, so it's probably the
wrong package to assign this bug too.
The display-manager.service symlink has some custom code in the
maintainer scripts of the individual packages.

We can use this bug report though, to come up with a scheme, how to do
that properly.
Then again, we already have
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=764607 which is sort
of related.

#832351#27
Date:
2016-12-20 23:30:47 UTC
From:
To:
Control: clone -1 -2
Control: reassign -1 xdm 1:1.1.11-3
Control: reassign -2 sddm 0.13.0-1

And indeed Didier Roche proposed a solution (in the form of a patch to
gdm3)[1]. I'm cloning and reassigning this bug to the two display
managers that do not have a bug already. The TLDR of the solution is:

1. Have your systemd unit Alias=display-manager.service
2. Use the --no-enable flag to dh_systemd_enable
3. Use `systemctl enable $DEFAULT_SERVICE` in the postinst

Step 1 and 2 should ensure the symlinks are removed on purge.

[1] https://bugs.debian.org/cgi-bin/bugreport.cgi?att=1;bug=764607;filename=use-systemd-alias.debdiff;msg=19

#832351#46
Date:
2018-12-15 13:31:43 UTC
From:
To:
Hello Felipe,
…

I'm doing some updates for nodm and had a look at this bug, too.

Is this bug still relevant? I do not see any indications on
tracker.debian.org nor any related lintian problem.

Further the patch in [1] is only partially applied to gdm3 (no
relevant change in postinst compared to nodm) and it contradicts at
least 1. of the list above (it *removes* the systemd unit
Alias=display-manager.service).

I compared the postints of gdm3 and nodem and they are the same in
this regard. Further the systemd unit file of nodm does not contain
Alias=display-manager.service (so no patch needed here?).

Greetings

     Helge