/lib/systemd/system/lightdm.service file has no [Install] clause

Bug #1584575 reported by Daniel Richard G.
20
This bug affects 4 people
Affects Status Importance Assigned to Milestone
lightdm (Ubuntu)
Confirmed
Medium
Unassigned
Nominated for Bionic by TJ

Bug Description

This concerns lightdm 1.18.1-0ubuntu1 in Xenial.

The /lib/systemd/system/lightdm.service file lacks an [Install] clause. Meaning, that if you do

    # systemctl disable display-manager

to prevent LightDM from starting, running

    # systemctl enable lightdm

does not restore the /etc/systemd/system/display-manager.service symlink, and thus does not re-enable LightDM to run at the next boot as intended.

Revision history for this message
Robert Ancell (robert-ancell) wrote :

Can you suggest what the [Install] clause should contain?

Changed in lightdm (Ubuntu):
status: New → Incomplete
importance: Undecided → Medium
Revision history for this message
Daniel Richard G. (skunk) wrote :

This whole systemd thing is new to me, and I can't say I'm terribly enamored of it, so I'm not the best person to ask. But by way of example, I'll point out what a couple other .service files do:

  /lib/systemd/system/rsyslog.service:
    [Install]
    WantedBy=multi-user.target
    Alias=syslog.service

  /lib/systemd/system/ssh.service:
    [Install]
    WantedBy=multi-user.target
    Alias=sshd.service

I'm pretty sure the LightDM file should have "Alias=display-manager.service", but can't say if "WantedBy" should be "multi-user.target" or "graphical.target" or something else.

Changed in lightdm (Ubuntu):
status: Incomplete → New
Revision history for this message
Martin Pitt (pitti) wrote :

 pitti | IIRC all *dm's postinsts need to set /etc/systemd/system/display-manager.service to
       | whatever was chosen in debconf
 pitti | setting Alias= sounds correct, but not WantedBy=
 pitti | we don't want *all* DMs to start
 pitti | the whole mechanics for that is still horribly complicated and redundant -- you can
       | use update-rc.d, debconf, /etc/X11/default-display-manager etc.
 pitti | I think /etc/X11/default-display-manager is still meant to be the canonical way to
       | configure this, that's why we skipped the [Install] sections so that you don't
       | introduce contradictions with systemctl enable/disable

Revision history for this message
Daniel Richard G. (skunk) wrote :

Maybe make display-manager.service into an actual service file (rather than a symlink), and have that start whatever /etc/X11/default-display-manager points to?

What I want is to be able to disable and then re-enable the display manager starting on boot using similar administrative commands, like a "systemctl disable/enable" pair. Even better if the argument to the commands is the same in both cases.

(Possibly even better yet if default-display-manager could be set to some "null" option, so you can disable/re-enable the display manager without ever touching systemd...)

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in lightdm (Ubuntu):
status: New → Confirmed
Revision history for this message
Craig (bombjack) wrote :

I too needed to re-enable graphical login after having disabled it.

I can confirm adding:

[Install]
Alias=display-manager.service

to my /lib/systemd/system/lightdm.service file.

Allowed me to re-enable lightdm to start on boot (by running "sudo systemctl enable lightdm"), previous to this I would end up booting to a black screen with a flashing cursor in the top left. Ctrl+Alt+F1 (for VT1) etc... would lead me to the login prompts, Ctrl+Alt+F7 leads me back to the screen with the flashing cursor (VT7).

So for me Ubuntu was expecting a graphical interface to be running and had me on VT7 at boot. Logging in from one of the other terminals showed lightdm to be stopped ("systemctl status lightdm"). Prior to the fix above I would have to manually start lightdm by logging in and running "sudo systemctl start lightdm"

I hope the above helps anyone googling the issue as it took me a couple of hours to track down why it wasn't starting when I thought it was re-enabled.

Revision history for this message
TJ (tj) wrote :

Thanks @Craig - helped someone in #ubuntu on 17.10, and I experimented on 18.04 and found it is still a problem there too.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.