Bug 11746

Summary: autologin not working with lighdm
Product: Mageia Reporter: Georges Eckenschwiller <paiiou>
Component: RPM PackagesAssignee: Mageia Bug Squad <bugsquad>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: Normal CC: jacques.stevez, jani.valimaa, mageia, magnux77, thierry.vignaud
Version: CauldronKeywords: PATCH
Target Milestone: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Source RPM: drakxtools CVE:
Status comment:
Attachments: Experimental/WIP patch for lightdm support in drakboot

Description Georges Eckenschwiller 2013-11-24 10:31:26 CET
Description of problem:
MCC does not allow to configure autologin

Steps to Reproduce:
1. Install mga4 beta1 with DVD
   Basic install with X server, without suggest => is OK
2. Reboot : DM = xdm, desktop = IceWM => is OK
3. Install lightdm (urpmi --no-suggest ligthdm-gtk2-greeter)
4. Reboot : DM = lightdm, desktop=IceWM => is OK
5. Execute drakconf and configure Boot (autologin with user)

=> autologin not working
NB package autologin is not installed and is not asked

Additional tries
----------------
1. Install package autologin (urpmi autologin)
   Configure with MCC
=> autologin not working and file /etc/sysconfig disappeared

2. Re-install package autologin
   Configure manually /etc/sysconfig/autologin
   USER=myself
   EXEC=/usr/bin/startx.autologin
   AUTOLOGIN=yes
=> autologin is working

NB I saw the report 4739, but the conditions being different, I thought of making a new report.

Reproducible: 

Steps to Reproduce:
Comment 1 Jani Välimaa 2013-11-24 15:32:44 CET
There's no need to install autologin rpm if lightdm is used. Drakboot is pretty broken currently as autologin will be disabled every time drakboot is started and even if it would work there's no autologin support for lightdm in drakboot. It's in my TODO, though.

To get autologin work properly with lightdm, you have to edit /etc/lightdm/lightdm.conf.d/50-mageia.conf by hand and add autologin=<user> under [SeatDefaults].

CC: (none) => jani.valimaa

Comment 2 Jani Välimaa 2013-11-24 15:39:27 CET
Created attachment 4522 [details]
Experimental/WIP patch for lightdm support in drakboot

You can try with this experimental/WIP patch. Cd to /usr/lib/libDrakX and apply it with 'patch -p2' and run drakboot.
Comment 3 Jani Välimaa 2013-11-24 16:11:55 CET
(In reply to Jani Välimaa from comment #1)
> To get autologin work properly with lightdm, you have to edit
> /etc/lightdm/lightdm.conf.d/50-mageia.conf by hand and add autologin=<user>
> under [SeatDefaults].

Currently 50-mageia.conf isn't tagged as conf file so it will be replaced with default one when lightdm is updated next time. Better to place your own .conf file with higher number to /etc/lightdm/lightdm.conf.d/. I should probably create a new .conf file for autologin when finishing autologin support for lightdm. I'll add all this to my TODO.
Comment 4 Georges Eckenschwiller 2013-11-25 08:10:34 CET
I tested the patch.
However, it is necessary to add to it an additional line
autologin-user-timeout=0
A value other than zero does not work according to my tries.

I found:
https://bugs.launchpad.net/ubuntu/+source/lightdm/+bug/902852
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=682473
Comment 5 Georges Eckenschwiller 2013-11-25 09:41:05 CET
I think of a last thing to be planned in the modified patch:
Allow to invalidate autologin from MCC
Comment 6 Georges Eckenschwiller 2013-11-25 13:00:29 CET
(In reply to Georges Eckenschwiller from comment #5)
> I think of a last thing to be planned in the modified patch:
> Allow to invalidate autologin from MCC

I am sorry.
autologin-user-timeout perturbed my tests.
The invalidation by CCM works perfectly.
Comment 7 Thierry Vignaud 2013-11-26 10:09:06 CET
Wrong package

CC: (none) => thierry.vignaud
Source RPM: drakconf-12.44-1 => drakxtools

Comment 8 Thierry Vignaud 2013-11-26 10:11:43 CET
Wrong summary

Summary: autologin not working => autologin not working with lighdm

Manuel Hiebel 2014-01-01 21:45:11 CET

Keywords: (none) => PATCH

Comment 9 Georges Eckenschwiller 2014-01-04 15:25:47 CET
The problem remains present.

I had tested the patch of Jani Välimaa.
It worked correctly, in the installation and in the removal.

Since my tests, Jani added the file 
/etc/lightdm/lightdm.conf.d/50-mageia-xfce.conf
It is necessary to modify the patch as a consequence?

It is also necessary to add the line
autologin-user-timeout=0

I do not know who has to make what
Comment 10 Jani Välimaa 2014-01-04 15:54:04 CET
(In reply to Georges Eckenschwiller from comment #9)
> 
> It is also necessary to add the line
> autologin-user-timeout=0
> 

Are you sure? Default value of 0 should be used if it's not explicitly set to some other value. I've never altered the default value and autologin has worked without any problems.
Comment 11 Georges Eckenschwiller 2014-01-04 16:09:59 CET
I had the problem during my first tries.
The search on the Internet seemed to confirm.

But I have just redone a new test.
The line is NOT necessary
Comment 12 Jani Välimaa 2014-01-04 16:10:32 CET
(In reply to Georges Eckenschwiller from comment #9)
> 
> Since my tests, Jani added the file 
> /etc/lightdm/lightdm.conf.d/50-mageia-xfce.conf
> It is necessary to modify the patch as a consequence?
>

That file comes from xfce4-session (and probably will be moved to mageia-xfce4-config after mga4 release). It's just used to pre-select Xfce session in lightdm-gtk-greeter when booting system first time after install (see bug 11613).

We already ship /etc/lightdm/lightdm.conf.d/50-mageia.conf with lightdm for mageia specific settings,but better option would be creating a whole new file (e.x. 50-mageia-autologin.conf) for autologin purposes and ship it with lightdm with %config(noreplace) tag. This way we can alter mageia specific settings later without affecting existing autologin settings.
Comment 13 Manuel Hiebel 2014-01-05 19:58:36 CET
*** Bug 12213 has been marked as a duplicate of this bug. ***

CC: (none) => magnux77

Comment 14 Nicolas Lécureuil 2014-01-07 11:56:54 CET
(In reply to Jani Välimaa from comment #12)
> (In reply to Georges Eckenschwiller from comment #9)
> > 
> > Since my tests, Jani added the file 
> > /etc/lightdm/lightdm.conf.d/50-mageia-xfce.conf
> > It is necessary to modify the patch as a consequence?
> >
> 
> That file comes from xfce4-session (and probably will be moved to
> mageia-xfce4-config after mga4 release). It's just used to pre-select Xfce
> session in lightdm-gtk-greeter when booting system first time after install
> (see bug 11613).
> 
> We already ship /etc/lightdm/lightdm.conf.d/50-mageia.conf with lightdm for
> mageia specific settings,but better option would be creating a whole new
> file (e.x. 50-mageia-autologin.conf) for autologin purposes and ship it with
> lightdm with %config(noreplace) tag. This way we can alter mageia specific
> settings later without affecting existing autologin settings.

do you think this can be fixed for the RC ?

CC: (none) => mageia

Comment 15 Jani Välimaa 2014-01-07 16:50:14 CET
I can submit my changes to drakx git repo (and to lightdm).
Comment 16 Jani Välimaa 2014-01-07 18:53:16 CET
Pushed changes to drakx git repo. However I don't know the correct procedure to create a new release so I'll leave it for someone who knows how to do it. Updated NEWS file, partially though.

Added also autologin file to lightdm, so when pushing new drakxtools also push lightdm.

Please note that autologin support isn't working 100%. Lightdm autologins to selected users last used session and not to session selected in drakboot as autologin-session setting isn't implemented yet in lightdm. Last used session is fetched via accountsservice (from file /var/lib/AccountsService/users/$USER). It might be good idea to add this info to errata.
Comment 17 Mageia Robot 2014-01-07 22:00:50 CET
commit 687d11bf2825b8143fc682e98dd09a189ebeeccc
Author: Thierry Vignaud <thierry.vignaud@...>
Date:   Tue Jan 7 22:00:35 2014 +0100

    perl_checker cleanups including fixing wrong variable name (mga#11746)
---
 Commit Link:
   http://gitweb.mageia.org/software/drakx/commit/?id=687d11bf2825b8143fc682e98dd09a189ebeeccc
Comment 18 Jani Välimaa 2014-01-09 15:59:37 CET
The wrong variable name caused settings not being read correctly when starting drakboot. Thx tv for fixing it.

Is new drakxtools release planned anytime soon? I've already asked for a freeze push for lightdm.
Comment 19 Georges Eckenschwiller 2014-01-12 19:38:06 CET
If I do not deceive, there is only a package drakxtools to be updated?
Comment 20 Georges Eckenschwiller 2014-01-13 14:22:28 CET
Thanks to all.
Autologin works now perfectly with Xfce, both in the activation and in the deactivation

Status: NEW => RESOLVED
Resolution: (none) => FIXED

Jacques Stevez 2016-04-03 15:43:42 CEST

CC: (none) => jacques.stevez