#769796 systemd: update-rc.d lightdm disable does not work

Package:
lightdm
Source:
lightdm
Description:
simple display manager
Submitter:
Samuel Thibault
Date:
2014-11-17 09:06:15 UTC
Severity:
normal
#769796#5
Date:
2014-11-16 14:50:08 UTC
From:
To:
Hello,

I want to have lightdm installed on my system, but not automatically
started at boot.  To achieve that, I used

update-rc.d lightdm disable

but lightdm still gets started at boot.

Samuel

#769796#10
Date:
2014-11-16 19:52:43 UTC
From:
To:
Hi Samuel,

Samuel Thibault wrote (16 Nov 2014 14:50:08 GMT) :

I see that lightdm.postinst reads:

  # set default-display-manager systemd service link according to our config
  if [ -e "$DEFAULT_DISPLAY_MANAGER_FILE" -a -d /etc/systemd/system/ ]; then
    SERVICE=/lib/systemd/system/$(basename $(cat "$DEFAULT_DISPLAY_MANAGER_FILE")).service
    if [ -e "$SERVICE" ]; then
      ln -sf "$SERVICE" /etc/systemd/system/display-manager.service
    else
      echo "ERROR: $SERVICE is the selected default display manager but does not exist" >&2
    fi
  fi

... which leads me to think that as long as the default DM is lightdm,
even if one disables the lightdm service, a display-manager service is
set up and will start. If my guess is correct, then that's a bug in
lightdm (or in the display-manager logic, perhaps other DMs have the
same), not in systemd.

What's the output of these commands?

  # systemctl status display-manager.service
  # systemctl status lightdm.service

Cheers,

#769796#17
Date:
2014-11-16 22:55:04 UTC
From:
To:
Hello,

● lightdm.service - Light Display Manager
   Loaded: loaded (/lib/systemd/system/lightdm.service; enabled)
   Active: active (running) since dim. 2014-11-16 23:51:12 CET; 55s ago
     Docs: man:lightdm(1)
  Process: 1238 ExecStartPre=/bin/sh -c [ "$(cat /etc/X11/default-display-manager 2>/dev/null)" = "/usr/sbin/lightdm" ] (code=exited, status=0/SUCCESS)
 Main PID: 1245 (lightdm)
   CGroup: /system.slice/lightdm.service
           ├─1245 /usr/sbin/lightdm
           ├─1254 /usr/bin/X :0 -seat seat0 -auth /var/run/lightdm/root/:0 -nolisten tcp vt7 -novtswitch
           └─2032 lightdm --session-child 12 19

nov. 16 23:51:12 type systemd[1]: Started Light Display Manager.
nov. 16 23:51:14 type lightdm[1946]: pam_unix(lightdm-greeter:session): session opened for user lightdm by (uid=0)

● lightdm.service - Light Display Manager
   Loaded: loaded (/lib/systemd/system/lightdm.service; enabled)
   Active: active (running) since dim. 2014-11-16 23:51:12 CET; 1min 5s ago
     Docs: man:lightdm(1)
  Process: 1238 ExecStartPre=/bin/sh -c [ "$(cat /etc/X11/default-display-manager 2>/dev/null)" = "/usr/sbin/lightdm" ] (code=exited, status=0/SUCCESS)
 Main PID: 1245 (lightdm)
   CGroup: /system.slice/lightdm.service
           ├─1245 /usr/sbin/lightdm
           ├─1254 /usr/bin/X :0 -seat seat0 -auth /var/run/lightdm/root/:0 -nolisten tcp vt7 -novtswitch
           └─2032 lightdm --session-child 12 19

nov. 16 23:51:12 type systemd[1]: Started Light Display Manager.
nov. 16 23:51:14 type lightdm[1946]: pam_unix(lightdm-greeter:session): session opened for user lightdm by (uid=0)

So it seems they are indeed aliases.  I have run

systemctl disable display-manager

and now lightdm doesn't start any more.

Samuel

#769796#24
Date:
2014-11-17 06:39:20 UTC
From:
To:
Hey Samuel,

Samuel Thibault [2014-11-16 23:55 +0100]:

Indeed I'm afraid this is a "wontfix". lightdm, gdm, and friends can't
directly enable/disable their units as this doesn't semantically make
sense together with /etc/X11/default-display-manager.  With the
decision/requirement to make multiple display managers installable in
parallel and selecting them via debconf (none of this is new in
systemd or related to systemd, BTW) you can't really disable "gdm" or
"lightdm", you can only disable "the display manager".

So I'm closing this. If you disagree and want to keep this open, this
should be reassigned to lightdm and tagged wontfix.

Thanks!

Martin

#769796#25
Date:
2014-11-17 08:55:26 UTC
From:
To:
Martin Pitt, le Mon 17 Nov 2014 07:39:20 +0100, a écrit :

Well, this used to be working before switching to systemd, and
it's really not obvious to the user that he now has to disable
display-manager too (and that can't be done through update-rc.d).

Perhaps it would be feasible to at least make all the update-rc.d
{xdm,gdm3,lightdm,etc.} emit a warning that this doesn't work when using
systemd, and systemctl disable display-manager should be used instead?
Otherwise I'm afraid we'll again get angry users.

Samuel

#769796#30
Date:
2014-11-17 09:03:39 UTC
From:
To:
Hello Samuel,

Samuel Thibault [2014-11-17  9:55 +0100]:

Not "too", only that.

Or perhaps rearranging the units to be more similar to the init
scripts again. But that's the decision of the *dm maintainers.

Thanks,

Martin