#752932 lightdm: systemd service file misses [Install] section

Package:
lightdm
Source:
lightdm
Description:
simple display manager
Submitter:
John Paul Adrian Glaubitz
Date:
2017-11-08 17:09:03 UTC
Severity:
normal
#752932#5
Date:
2014-06-27 20:52:02 UTC
From:
To:
Hello!

The systemd service file currently supplied with lightdm does not
provide an install section, it is therefore not possible to disable
and re-enable lightdm with systemd's systemctl:

root@test-adrian1:~> systemctl disable lightdm.service
Synchronizing state for lightdm.service with sysvinit using update-rc.d...
Executing /usr/sbin/update-rc.d lightdm defaults
Executing /usr/sbin/update-rc.d lightdm disable
insserv: warning: current start runlevel(s) (empty) of script `lightdm' overrides LSB defaults (2 3 4 5).
insserv: warning: current stop runlevel(s) (0 1 2 3 4 5 6) of script `lightdm' overrides LSB defaults (0 1 6).
rm '/etc/systemd/system/display-manager.service'
root@test-adrian1:~> systemctl enable lightdm.service
Synchronizing state for lightdm.service with sysvinit using update-rc.d...
Executing /usr/sbin/update-rc.d lightdm defaults
insserv: warning: current start runlevel(s) (empty) of script `lightdm' overrides LSB defaults (2 3 4 5).
insserv: warning: current stop runlevel(s) (0 1 2 3 4 5 6) of script `lightdm' overrides LSB defaults (0 1 6).
Executing /usr/sbin/update-rc.d lightdm enable
The unit files have no [Install] section. They are not meant to be enabled
using systemctl.
Possible reasons for having this kind of units are:
1) A unit may be statically enabled by being symlinked from another unit's
   .wants/ or .requires/ directory.
2) A unit's purpose may be to act as a helper for some other unit which has
   a requirement dependency on it.
3) A unit may be started when needed via activation (socket, path, timer,
   D-Bus, udev, scripted systemctl call, ...).
root@test-adrian1:~>

With the attached patch, disabling and enabling works correctly:

root@test-adrian1:~> systemctl disable lightdm.service
Synchronizing state for lightdm.service with sysvinit using update-rc.d...
Executing /usr/sbin/update-rc.d lightdm defaults
Executing /usr/sbin/update-rc.d lightdm disable
insserv: warning: current start runlevel(s) (empty) of script `lightdm' overrides LSB defaults (2 3 4 5).
insserv: warning: current stop runlevel(s) (0 1 2 3 4 5 6) of script `lightdm' overrides LSB defaults (0 1 6).
root@test-adrian1:~> systemctl enable lightdm.service
Synchronizing state for lightdm.service with sysvinit using update-rc.d...
Executing /usr/sbin/update-rc.d lightdm defaults
insserv: warning: current start runlevel(s) (empty) of script `lightdm' overrides LSB defaults (2 3 4 5).
insserv: warning: current stop runlevel(s) (0 1 2 3 4 5 6) of script `lightdm' overrides LSB defaults (0 1 6).
Executing /usr/sbin/update-rc.d lightdm enable
ln -s '/lib/systemd/system/lightdm.service' '/etc/systemd/system/display-manager.service'
root@test-adrian1:~>

Cheers,

Adrian

#752932#10
Date:
2014-06-28 08:42:45 UTC
From:
To:
Control: tag -1 pending

Thanks, will be part of the next upload.

#752932#17
Date:
2014-09-15 09:16:49 UTC
From:
To:
Hi,

Looking at

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=733220#25

use of those aliases seems discouraged. Same in

https://titanpad.com/s-gsprintchangelog

= default display manager selection =
...

  * In DM packages' .service files: Don't have an [Install] section
    (Dependency or Alias) as systemctl enable will otherwise make the last
    installed package "win" instead of the one selected in debconf

Did things change?

Regards,

#752932#22
Date:
2014-09-15 11:03:55 UTC
From:
To:
Good point, I don't think so. John, if you think this feature is useful,
please ask Martin or Joss. Meanwhile, I'll just revert the changes in
svn.

Regards,

#752932#31
Date:
2017-11-08 10:43:43 UTC
From:
To:
Hi Yves-Alexis,

three years ago you reverted a fix for this bug because using an Alias in
lightdm.service seemed discouraged by the systemd maintainers. As can be
seen in https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=764607#24 they
later changed their mind, and going ahead with
Alias=display-manager.service would also be part of the fix for #775385,
which has been cloned for xdm (#832351), nodm (#852125) and sddm
(#848936).

Florian

#752932#36
Date:
2017-11-08 12:23:43 UTC
From:
To:
Hi,

was there any coordination with Martin and Joss about this? The display-
manager.service management needs to be shared with all the display managers
anyway.

Regards,

#752932#41
Date:
2017-11-08 17:06:59 UTC
From:
To:
the bug I linked to contains mails from Didier Roche, where he says that
he discussed the topic with Martin and the result is to use an [Install]
section with Alias; and he also mentions taking it to the gdm3-pkg team,
who discovered an issue with "systemctl enable --force gdm3" failing
"due to the autogenerated gdm3 service script". There's #771085 which
includes the same suggestion from Andreas Beckmann as the other bugs
mentioned above, but no further reaction from the Gnome maintainers;
unless maxy is one of them, in which case he commented in #764607

Florian