Please let vendors easily provide their own config

Bug #799754 reported by Lionel Le Folgoc
32
This bug affects 3 people
Affects Status Importance Assigned to Milestone
lightdm (Ubuntu)
Fix Released
High
Robert Ancell

Bug Description

Binary package hint: lightdm

Hi,

Could you register lightdm.conf in the alternatives system? This would let derivatives set another default config easily (as done with gdm), and avoid the dpkg-divert nightmare that is going with gdm3.

(currently, daily builds of xubuntu don't start any session because lightdm tries to start gnome which doesn't exist...)

Thanks.

Revision history for this message
Charlie Kravetz (cjkgeek) wrote :

Thanks for reporting this bug and any supporting documentation. Since this bug has enough information provided for a developer to begin work, I'm going to mark it as confirmed and let them handle it from here.

This is preventing Xubuntu from having a live desktop session, and all installs must be run using "Install Xubuntu" from the cd menu. If the menu is missed, the user gets a black screen with no prompts or cursor, and must reboot to restart the cd.

 Thanks for taking the time to make Ubuntu better!

Changed in lightdm (Ubuntu):
importance: Undecided → High
status: New → Triaged
Revision history for this message
Robert Ancell (robert-ancell) wrote :

I approve of this. I don't know how to configure this, but I'll happily sponsor a patch.

Revision history for this message
Lionel Le Folgoc (mrpouit) wrote :

Sorry if I wasn't really clear, here is a better explanation:

It would be useful if lightdm default config (/etc/lightdm/lightdm.conf) could be overridden by default by a distributor shipped one (e.g. /etc/lightdm/lightdm-vendor.conf, or something like that).
If this file is present, then the main config file isn't used, and lightdm automatically uses the other one.

Then, it would give the following scenario:
* the default config is ok for Ubuntu, so probably nothing to do (or maybe register it with the lowest priority, e.g. "update-alternatives --install /etc/lightdm/lightdm-vendor.conf lightdm-vendor-config /etc/lightdm/lightdm.conf 20" in ubuntu-artwork.postinst)
* Xubuntu needs to change the default session, so it will ship a custom config file (e.g. /etc/xdg/xdg-xubuntu/lightdm/lightdm.conf), and register it as an alternative (priority greater than 20) to /etc/lightdm/lightdm-vendor.conf (e.g. "update-alternatives --install /etc/lightdm/lightdm-vendor.conf lightdm-vendor-config /etc/xdg/xdg-xubuntu/lightdm/lightdm.conf 50" in xubuntu-default-settings.postinst)
* Another derivative can do the same with its own priority, greater than 20, e.g. "update-alternatives --install /etc/lightdm/lightdm-vendor.conf lightdm-vendor-config /somewhere/other/derivative/lightdm.conf 60".

By default, the highest installed priority will win.

Thanks to that, an admin (or a user) with several *-desktop metapackages can choose its preferred vendor config by playing with "update-alternative --config lightdm-vendor-config", just like what can be done for $editor.

The changes are rather minimal in lightdm, I'll post a few patches soon (only init script changes).

Revision history for this message
Lionel Le Folgoc (mrpouit) wrote :

Here's what the patch looks like (not really tested, I don't know if the "script" token in upstart support shell variables, so you might want to adjust that).

summary: - Please register lightdm.conf in the alternatives system
+ Please let vendors easily provide their own config
Revision history for this message
Lionel Le Folgoc (mrpouit) wrote :

(changed the title to be less misleading)

tags: added: patch
tags: added: iso-testing
Revision history for this message
Martin Pitt (pitti) wrote :

@Lionel: Yes, the "script" section gets passed to /bin/sh, so that works.

Robert, WDYT about this? Seems harmless for the case when the custom file is not there.

Changed in lightdm (Ubuntu):
assignee: nobody → Robert Ancell (robert-ancell)
Revision history for this message
Robert Ancell (robert-ancell) wrote :

Sorry for the big delay in getting back to this. I guess this works if you want Xubuntu to override the Ubuntu config. However it doesn't work if you add a third party. Perhaps we should split the config into a separate package? That way there's a lightdm-config-ubuntu and a lightdm-config-xubuntu package (the both would obviously have to conflict with eachother). Note that lightdm can run without a config file so this would be fine if you had no package installed.

Errors in the patch:
- The exec line is missing --config
- Has tabs instead of spaces

Revision history for this message
Mario Limonciello (superm1) wrote :

I think this can become troublesome when you need to change things like autologin. For example ubquity will write out the autologin settings to /etc/lightdm/lightdm.conf and any userspace tool for changing these settings would likely be looking there too.

So if this solution is accepted, then those tools will all need to be adjusted too.

I think a better solution would be to allow lightdm to parse the standard conf by default, and then parse the vendor conf for any "override" values for things in the standard conf. That keeps all other tools just having to look at a single file.

tags: added: patch-needswork
removed: patch
Revision history for this message
Lionel Le Folgoc (mrpouit) wrote :

> Perhaps we should split the config into a separate package? That way there's
> a lightdm-config-ubuntu and a lightdm-config-xubuntu package (the both would
> obviously have to conflict with eachother).

This is overkill to create packages for only one conffile, and probably a mess
to deal with on upgrades or when you install the other variant (and that
doesn't look like a sane use of conflicts).

> Errors in the patch:
> - The exec line is missing --config
> - Has tabs instead of spaces

No:
- "-c" is used, according to the manpage, it has the same meaning...
- then fix the orig files? because they already contain a mix of tabs and
  spaces

> I think a better solution would be to allow lightdm to parse the standard
> conf by default, and then parse the vendor conf for any "override" values for
> things in the standard conf. That keeps all other tools just having to look
> at a single file.

Yes, similar to what Didier did for gdm (set-default-session). This is much
better. But given the time needed to review the tiny patch above (and the
review), I'm not very inclined to start working on a more complicated one...

I guess I'll forget any attempt to do this cleanly and go back to the
dpkg-divert way. Feel free to close this bug report.

Revision history for this message
Julien Lavergne (gilir) wrote :

Just to mention that Lubuntu has the same problem.

We use also update-alternative system with LXDM (to have LXDE genuine theme, and Lubuntu theme), and it's working quite well. It would be unfortunate if all Ubuntu flavors share the same display manager, but can't set their settings easily.

Revision history for this message
Sergey "Shnatsel" Davidoff (shnatsel) wrote :

This bug is blocking lots of stuff in elementary OS, too.

Debian alternatives system would be so much easier to deal with than all those ugly unmaintainable diverts :-/

Revision history for this message
Mario Limonciello (superm1) wrote :

Likewise for Mythbuntu.

This will block lots of potential testing time for users.

Revision history for this message
Martin Pitt (pitti) wrote :

Just discussed on IRC. Summary:

 - We'll make the internal defaults DTRT, and not ship with any conffile
 - xubuntu-default-settings can then ship their own /etc/lightdm/lightdm.conf, preferably as a non-conffile though.
 - Default session can be set with providing a /usr/share/xsessions/default.desktop symlink instead of a configuration file. This was originally agreed in https://launchpad.net/ubuntu/+spec/desktop-o-cd-localization as a way to circumvent changing the conffile, but if it's not going to be a conffile any more, this is not actually required any more.

Revision history for this message
Martin Pitt (pitti) wrote :

This is now pretty much a duplicate of bug 806064.

Revision history for this message
Lionel Le Folgoc (mrpouit) wrote :

Thanks for taking care of that.

> - Default session can be set with providing a /usr/share/xsessions/default.desktop
> symlink instead of a configuration file. This was originally agreed in
> https://launchpad.net/ubuntu/+spec/desktop-o-cd-localization as a way to
> circumvent changing the conffile, but if it's not going to be a conffile any
> more, this is not actually required any more.

You're probably already aware of that, but this will require "special care" from gdm/lightdm/$dm if your session relies on the xdg base dir spec for its default config (with the 60x11-common_xdg_path script in x11-common), with /etc/xdg/xdg-default instead of the expected /etc/xdg/xdg-${dereferenced_symlink_name}...

(Anyway, we don't have a guest session in xubuntu, so we'll still need to ship a custom lightdm.conf to disable it.)

Revision history for this message
Sergey "Shnatsel" Davidoff (shnatsel) wrote :

In the solution proposed by Martin Pitt all the fun happens on multi-DE installations. For example, xubuntu-desktop _depends_ on xubuntu-default-settings, and if a similar package for a different distro gets installed (lubuntu, mythbuntu, elementary, ubuntu-studio, whatever), dpkg complains that two packages contain the same file, presents it like a fatal bug and paralyzes itself.

You can make each package containing such a file provide a virtual package with which it will conflict and which it will replace *cough*, but that makes installing two distro metapackages at the same time impossible, and that sounds pretty ridiculous.

There are also derivatives of derivatives and derivatives of derivatives of derivatives, and with this system they are deeply screwed and are doomed to use ugly workarounds.

Please, use some prioritizing system. Debian's alternatives seem to be the best for this case. It will provide flexibility for generations of derivatives to come. You can also try to utilize GSettings, but it's not as good as a real alternatives system for cases like this.

Revision history for this message
Lionel Le Folgoc (mrpouit) wrote :

Lightdm 0.9.2 uploaded in oneiric today has added support for what Martin described. Thanks, that's appreciated. :)

> - Config changes:
> [...]
> - The default user session is now "default". Distributions should put a
> symlink to their chosen default or set one in lightdm.conf.
> [...]
> * debian/lightdm.conf:
> - Removed, no longer needs configuration

Now, if I try to sum up, derivatives will want to use alternatives for:
- /etc/lightdm/lightdm.conf
- /usr/share/xsessions/default.desktop

I don't think it will work very well if a package ships these files directly instead of using update-alternatives, but if everyone agrees, it shouldn't happen...

Unfortunately, this upload introduced new issues:
- /etc/lightdm/lightdm.conf is not shipped anymore by lightdm, but apparently hasn't been cleaned on upgrades with rm_conffile, so it's still here for existing oneiric systems...
- a new conffile has been introduced /etc/lightdm/users.conf. Hopefully we won't need to change it per derivative? Otherwise we're back to the same issue, again...

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

OpenSUSE has and /etc/sysconfig file for display managers. I think a good solution would be for Debian to have one in /etc/default. Does anyone know what the process is for adding this? LightDM upstream will then support loading config from /etc/default and /etc/sysconfig so it will work on all systems without requiring a config file.

Revision history for this message
Lionel Le Folgoc (mrpouit) wrote :

I've uploaded a new xubuntu-default-settings revision that uses alternatives for /etc/lightdm/lightdm.conf and /usr/share/xsessions/default.desktop earlier today. In parallel, a new mythbuntu-lightdm-theme package was uploaded, and its postinst does a copy of a custom lightdm.conf file to /etc/lightdm/lightdm.conf (from a quick look).

Maybe we should state _clearly_ whether we want to support derivatives/multi-DEs... If not, then we can continue implementing different and not so compatible solutions in each package like we're doing right now.

Revision history for this message
Mario Limonciello (superm1) wrote :

Yes I think we need a clear answer on how it should be done distro wide.

I was waiting for such an answer on this bug but a3 is around the corner and needed some solution. Since nothing came decided to go with the easier route of just copying the file in place from postinst.

I'm indifferent to one way or the other myself, but we should all get on the same path after a3.

Changed in lightdm (Ubuntu):
milestone: none → ubuntu-11.10-beta-1
Revision history for this message
Sebastien Bacher (seb128) wrote :

is that still an issue? lightdm stopped shipping a config so derivates should be able to ship their own

Revision history for this message
Sebastien Bacher (seb128) wrote :

Lionel, derivates are supported and we want to make their job as easy as we can, the current version should support what is needed to build any derivate, the remaining issue is what happens if you try to install several desktops at the same time including their custom default configuration

Revision history for this message
Charlie Kravetz (cjkgeek) wrote :

Unfortunately, this is not resolved as shown by the issues trying to auto-login to a live session. Since lightdm now allows "ubuntu" only to be used for a live session, and will not allow the solution used by Lionel to work. Since Xubuntu used a symlink to /etc/lightdm/lightdm.conf, live session can not even see the user name Ubuntu, and can not auto-login. That does not seem like a valid solution to this bug report.

Revision history for this message
Sebastien Bacher (seb128) wrote :

Why does lightdm allows "ubuntu" only to be used? the xubuntu settings binary could install config with another session?

Revision history for this message
Mario Limonciello (superm1) wrote : Re: [Mythbuntu-bugs] [Bug 799754] Re: Please let vendors easily provide their own config

It's hardcoded to load a session called 'ubuntu' rather than something
called 'default'. So this means that a lightdm conf file has to override
the default and a symlink to default.desktop does nothing.

On Wed, Aug 10, 2011 at 19:20, Sebastien Bacher <email address hidden> wrote:

> Why does lightdm allows "ubuntu" only to be used? the xubuntu settings
> binary could install config with another session?
>
> --
> You received this bug notification because you are a member of Mythbuntu
> Bug Team, which is subscribed to the bug report.
> https://bugs.launchpad.net/bugs/799754
>
> Title:
> Please let vendors easily provide their own config
>
> Status in “lightdm” package in Ubuntu:
> Triaged
>
> Bug description:
> Binary package hint: lightdm
>
> Hi,
>
> Could you register lightdm.conf in the alternatives system? This would
> let derivatives set another default config easily (as done with gdm),
> and avoid the dpkg-divert nightmare that is going with gdm3.
>
> (currently, daily builds of xubuntu don't start any session because
> lightdm tries to start gnome which doesn't exist...)
>
> Thanks.
>
> To manage notifications about this bug go to:
>
> https://bugs.launchpad.net/ubuntu/+source/lightdm/+bug/799754/+subscriptions
>
> _______________________________________________
> Mailing list: https://launchpad.net/~mythbuntu-bugs
> Post to : <email address hidden>
> Unsubscribe : https://launchpad.net/~mythbuntu-bugs
> More help : https://help.launchpad.net/ListHelp
>

--
Mario Limonciello
<email address hidden>

Revision history for this message
Sebastien Bacher (seb128) wrote :

right, but what is wrong in overwriting the default in a configuration? why doesn't that work?

btw this was uploaded this week, does it fix the issue?

lightdm (0.9.3-0ubuntu2) oneiric; urgency=low
...
  [ Didier Roche ]
  * Cherry-pick from upstream:
    - lightdm-set-defaults enables tweaking the default session and chosen
      greeter for lightdm. This is useful for derivatives waiting to not ship
      the whole configuration file of lightdm

Revision history for this message
Charlie Kravetz (cjkgeek) wrote :

No, this is not resolved. Using the symlink as mentioned in Comment #13 above still does not allow a user to log in to the correct session. Further, the latest changes to lightdm give Xubuntu a black background with the unity-greeter text and icon. This is far from correct for all of us to be able to use it. Not choosing a session gives the wrong session when logging in, and knowing to click an icon of a gear is not intuitive. When the wrong session is used, it still takes 12 steps to reset so the user can log into the correct session.

Revision history for this message
Lionel Le Folgoc (mrpouit) wrote :

Yep, the lightdm-set-defaults tool fixes the issue when you use it in the maintainer scripts as described by Didier (cf. <http://lists.freedesktop.org/archives/lightdm/2011-August/000046.html>). Maybe new issues arose, but at least the default session and greeters can be set easily now. Thanks.

Changed in lightdm (Ubuntu):
status: Triaged → Fix Released
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.