g-c-c "automatic login" settings not working with lightdm

Bug #798962 reported by Carl Karsten on 2011-06-17
This bug affects 10 people
Affects Status Importance Assigned to Milestone
accountsservice (Ubuntu)
Canonical Desktop Team
Canonical Desktop Team
lightdm (Ubuntu)
Canonical Desktop Team
Canonical Desktop Team

Bug Description

Binary package hint: gnome-control-center

sytem, user accounts, select user, unlock, enter sudo pw, change "Automatic Login" to Yes, close window. drill into it, "Automatic Login" is No. Set to yes again, reboot, not logged in.

ProblemType: Bug
DistroRelease: Ubuntu 11.10
Package: gnome-control-center 1:3.0.2-1ubuntu4
ProcVersionSignature: Ubuntu 3.0-1.2-generic 3.0.0-rc3
Uname: Linux 3.0-1-generic x86_64
Architecture: amd64
Date: Fri Jun 17 16:01:44 2011
ExecutablePath: /usr/bin/gnome-control-center
 PATH=(custom, user)
SourcePackage: gnome-control-center
UpgradeStatus: No upgrade log present (probably fresh install)

Carl Karsten (carlfk) wrote :
Sebastien Bacher (seb128) wrote :

thank you for your bug report, do you use gdm or lightdm?

Changed in gnome-control-center (Ubuntu):
importance: Undecided → Low
status: New → Incomplete
Carl Karsten (carlfk) wrote :

> thank you for your bug report, do you use gdm or lightdm?


Sebastien, how exactly is a functional regression like this considered to be low importance?

Changed in gnome-control-center (Ubuntu):
status: Incomplete → New
importance: Low → Medium

Can confirm at least that the setting is not saved. Just have to finish a task and will restart to check that it's not respected.

Changed in gnome-control-center (Ubuntu):
status: New → Confirmed

Perhaps the problem is in gnome-settings-daemon though, since that is where the setting is stored.

Running 'gnome-control-center user-accounts' from command line and changing the switch gives:

(gnome-control-center:4867): user-accounts-cc-panel-WARNING **: SetAutomaticLogin call failed: failed to change automatic login: No such file or directory

I guess it might be using a wrong path or name to change the setting, so the bug should stay here

affects: gnome-control-center (Ubuntu) → ubuntu
affects: ubuntu → gnome-control-center (Ubuntu)
Changed in gnome-control-center (Ubuntu):
status: Confirmed → Triaged
summary: - "automatic login" not saved or respected
+ g-c-c "automatic login" settings not working with lightdm
Changed in lightdm (Ubuntu Oneiric):
status: New → Triaged
importance: Undecided → Medium
tags: added: iso-testing
Michael Terry (mterry) wrote :

This is working for me now. What about others?

Daniel Manrique (roadmr) wrote :


I tried an Oneiric Alpha 3 image (20110803.1) and it's still not working for me. Could you let us know the date of the image you tried?

Julien Olivier (julo) wrote :

I have tested in Oneiric Alpha 3 with lightdm and gdm and it doesn't work with either of them.

Changed in gnome-control-center (Ubuntu Oneiric):
assignee: nobody → Canonical Desktop Team (canonical-desktop-team)
Changed in lightdm (Ubuntu Oneiric):
assignee: nobody → Canonical Desktop Team (canonical-desktop-team)
Michael Terry (mterry) wrote :

Sorry, my report was just from not seeing the console error. I didn't test actually logging in. Looking at this now.

Hello! I've working on adding support to accountsservice for LightDM, which Ubuntu is switching to starting with Ubuntu 11.10.

Currently, accountsservice assumes GDM is in use. (It matters only for saving and loading autologin settings.)

This patch will do two things:
 1) When saving autologin settings, try to write to both GDM and LightDM config files, if they are available.

 2) When loading autologin settings, try to determine which of GDM and LightDM are running and load from its respective config file.

That's probably okay.

Maybe a better approach, though, would be to get away from DM specific code and make accounts service manage its own configuration that the DMs use instead of their own configuration.


Created attachment 50137
Proposed patch

One notable thing about this patch is how it checks whether GDM is running. It currently checks if org.gnome.DisplayManager is owned. Is there a better way?

(In reply to comment #2)
> Created an attachment (id=50137) [details]
> Proposed patch
> One notable thing about this patch is how it checks whether GDM is running. It
> currently checks if org.gnome.DisplayManager is owned. Is there a better way?

org.gnome.DisplayManager seems reasonable to me.

Other than that, are you happy with your patch?

As for the patch, I have done some quick tests and it seems to work for me. I'll likely play with it another day or so and make sure I don't hit any issues. So if you want to hold off until I give a more resounding vote of QA confidence, that's reasonable.

As for config files, I'm fine with either way (accountsservice tweaking others' files or having its own), but I'm not a main LightDM or GDM developer so can't really speak to how easy a central config file would be to adopt.

This is just one config value (autologin user). If that's all that's envisioned, I'm not sure it's worth having a special config file. But if you plan to add more display manager settings to accountsservice, maybe it starts to make sense.

alright, let's go with this approach for now, but reconsider if we end up moving more options (like include/exclude lists?) or gain interest from other DMs

Michael Terry (mterry) wrote :

This is because accountsservice currently assume GDM. I have a patch.

affects: gnome-control-center (Ubuntu Oneiric) → accountsservice (Ubuntu Oneiric)
Changed in lightdm (Ubuntu Oneiric):
status: Triaged → Invalid
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package accountsservice - 0.6.13-1ubuntu1

accountsservice (0.6.13-1ubuntu1) oneiric; urgency=low

  * debian/patches/0007-add-lightdm-support.patch:
    - Add support for reading/setting LightDM's autologin preference.
      LP: #798962
 -- Michael Terry <email address hidden> Thu, 11 Aug 2011 15:14:57 -0400

Changed in accountsservice (Ubuntu Oneiric):
status: Triaged → Fix Released
Michael Terry (mterry) wrote :

Can people please confirm that GDM and accountsservice still work perfectly? My GDM isn't working.

Julien Olivier (julo) wrote :

I can confirm that it *doesn't* work with GDM either.

Michael Terry (mterry) wrote :

Julien, you say "either". Do you mean that GDM didn't work with autologin even before my update? I had thought it was working.

Changed in accountsservice:
importance: Unknown → Medium
status: Unknown → Confirmed
Julien Olivier (julo) wrote :


Some time ago, I tested with GDM and it didn't work (auto-login used to work on natty, but it broke when I upgraded to oneiric). Now, it seems to write the /etc/gdm/custom.conf file correctly but doesn't start at all.

Julien Olivier (julo) wrote :

Maybe that's another bug, but g-c-c doesn't seem to set the default session in /etc/lightdm/lightdm.conf. Should it be set to the current user session? Or maybe lightdm should respect ~/.dmrc instead of starting the default session and overwriting the ~/.dmrc?

Because of that, if you want to activate auto-login with gnome-shell session (for example), you have to manually edit /etc/lightdm/lightdm.conf and add "user-session=gnome-shell". Else, it defaults to the "ubuntu" session.

Sam_ (and-sam) wrote :

Julien there is Bug #823718 concerning to replace .dmrc

Fwiw, I've always considered the current 'gdm support' a hack that should go away when gdm starts talking to accountsservice. It makes a lot more sense for the accountsservice to store this information itself, and for interested DMs to query it.


As the LightDM maintainer I very much support the idea of having LightDM reading configuration from the accounts service.

I am currently gauging interest on if other desktops will adopt AccountsService:

Rocko (rockorequin) wrote :

The current behaviour in Oneiric Beta1 is that I can turn automatic login *on*, but I can't turn it back *off*. g-c-c reports correctly that it is turned off, but neither /etc/gdm/custom.conf nor /etc/lightdm/lightdm.conf are adjusted.

Is that a separate bug or is it still being addressed by this one? If it is this bug, I would say that it is much higher importance not being able to turn automatic login off.

Mike, the patch doesn't apply any more to 0.6.14. Do you mind porting it? Are you happy with how well it works?

Created attachment 51002
Patch #2

Here's an updated patch for 0.6.14 (and it fixes a bug with detecting LightDM's autologin status). Works for me now.

Michael Terry (mterry) wrote :

Rocko, are you still seeing that? I can't reproduce that (not being able to turn off autologin).

Comment on attachment 51002
Patch #2

Review of attachment 51002:

::: src/daemon.c
@@ +1446,5 @@
> +{
> + if (!save_autologin_gdm (daemon, name, enabled, error))
> + return FALSE;
> + if (!save_autologin_lightdm (daemon, name, enabled, error))
> + return FALSE;

Hmm, I feel like this should always try both save functions, if we don't want to look for which dm is actually in use.

ie it should be something like

result = TRUE;
result &= save_autologin_gdm(...);
result &= save_autologin_lightdm(...);
return result;

Hi all!

Any news on this?

Comment #6 still stands - this needs to be flipped around. Make 'autologin=yes' per-user information that is provided by the accountsservice, and make interested display managers use that information.

Adding code for reading and writing all the display managers config file formats is not a sane or scalable approach.

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

Duplicates of this bug

Other bug subscribers

Remote bug watches

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