Bug 1128385

Summary: Server installation: Automatic User login offered
Product: [openSUSE] openSUSE Tumbleweed Reporter: Donald Curtis <bugrprt21882>
Component: InstallationAssignee: Stefan Hundhammer <shundhammer>
Status: RESOLVED FIXED QA Contact: Jiri Srain <jsrain>
Severity: Normal    
Priority: P3 - Medium CC: dgonzalez, mlin, okurz, snwint
Version: Current   
Target Milestone: ---   
Hardware: x86-64   
OS: openSUSE Factory   
URL: https://trello.com/c/VVM2ib4G
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Donald Curtis 2019-03-07 17:26:39 UTC
During a Server installation, at the "1st" User dialogue, the option of "Automatic Login" is offered.

Doesn't really make sense because, the only login possible is at a VT which, doesn't automatically login.
Comment 1 David Diaz 2019-03-08 09:00:16 UTC
Thank you for the report, Donald.

The issue is now tracked in our internal board to be prioritized.
Comment 2 Ancor Gonzalez Sosa 2019-03-08 11:58:53 UTC
*** Bug 1060173 has been marked as a duplicate of this bug. ***
Comment 3 Stefan Hundhammer 2019-04-16 15:41:44 UTC
Fixed with yast2-pam-4.2.0 and yast2-users-2.4.0.

Pull requests:

  https://github.com/yast/yast-pam/pull/13
  https://github.com/yast/yast-users/pull/205

Submit requests to OBS (Factory):

  yast2-pam:   https://build.opensuse.org/request/show/694832 
  yast2-users: https://build.opensuse.org/request/show/694833
Comment 4 Max Lin 2019-04-23 07:58:07 UTC
This change looks breaking auto-login on Tumbleweed GNOME/KDE[1][2], we see this in the TW staging.

yast2_users: https://build.opensuse.org/request/show/695483
yast2_pam: https://build.opensuse.org/request/show/695483

[1] https://openqa.opensuse.org/tests/913479
[2] https://openqa.opensuse.org/tests/913480

Can you have a look does this change broken TW?
Comment 5 Stefan Hundhammer 2019-04-23 08:41:10 UTC
(In reply to Max Lin from comment #4)
> This change looks breaking auto-login on Tumbleweed GNOME/KDE[1][2], we see
> this in the TW staging.
> 
> yast2_users: https://build.opensuse.org/request/show/695483
> yast2_pam: https://build.opensuse.org/request/show/695483
> 
> [1] https://openqa.opensuse.org/tests/913479
> [2] https://openqa.opensuse.org/tests/913480

I really don't see how this is related to this bug report. This bug report was about enabling or not enabling the "autologin" checkbox during installation. In both those openQA tests that checkbox is there and enabled (as it should be).

The problem in those openQA test cases appears to be that no login manager is started. That is not what this bug is all about.
Comment 6 Stefan Hundhammer 2019-04-23 08:55:04 UTC
Possibly related: Bug #1130158
Comment 7 Max Lin 2019-04-23 09:14:01 UTC
(In reply to Stefan Hundhammer from comment #5)
> (In reply to Max Lin from comment #4)
> > This change looks breaking auto-login on Tumbleweed GNOME/KDE[1][2], we see
> > this in the TW staging.
> > 
> > yast2_users: https://build.opensuse.org/request/show/695483
> > yast2_pam: https://build.opensuse.org/request/show/695483
> > 
> > [1] https://openqa.opensuse.org/tests/913479
> > [2] https://openqa.opensuse.org/tests/913480
> 
> I really don't see how this is related to this bug report. This bug report
> was about enabling or not enabling the "autologin" checkbox during
> installation. In both those openQA tests that checkbox is there and enabled
> (as it should be).
> 
> The problem in those openQA test cases appears to be that no login manager
> is started. That is not what this bug is all about.

Where did you see login manager isn't started... Yes, these test cases is about "autologin", however autologin does not work since the login manager *appeared*

https://openqa.opensuse.org/tests/913479#step/first_boot/2
https://openqa.opensuse.org/tests/913480#step/first_boot/1

Can be related to Bug #1130158 , this staging only contains changes of Bug #1130158 and Bug #1128385.
Comment 8 Ludwig Nussel 2019-04-23 12:32:19 UTC
seems to be TW only. moving over
Comment 9 Stefan Hundhammer 2019-04-23 15:42:55 UTC
So I pulled one of those images and tried it, and indeed in /etc/sysconfig/displaymanager the AUTOLOGIN=  key is empty.

Several times during installation, availability of a suitable display manager that supports autologin is checked, and it's always successful: It always finds "sddm" (since I selected system role KDE Plasma desktop). But then it's checked one last time, and this time it returns "not supported":


2019-04-23 17:20:03 <1> g121(4365) [Ruby] modules/Autologin.rb:183 
  Autologin is supported

2019-04-23 17:20:03 <1> g121(4365) [Ruby] modules/Autologin.rb:183
  Autologin is supported

2019-04-23 17:20:03 <1> g121(4365) [Ruby] modules/Autologin.rb:183 
  Autologin is supported

2019-04-23 17:27:41 <1> g121(4365) [Ruby] modules/Autologin.rb:185 
  Autologin is not supported:
  No package provides any of 
  ["autologin-support", "kdm", "gdm", "sddm", "lightdm"]



I guess at that point the installation repos are already detached from libzypp, and of course there is no installed system yet (since it was installed into a chroot environment) that could report that it has a suitable display manager.

And I suspect that this is just the time when it is requested to write the configuration for that part, so it won't add that parameter since it thinks autologin is not supported by the target system.

That should be a hint how to fix this.
Comment 10 Stefan Hundhammer 2019-04-23 15:52:29 UTC
Yes, shutting down libzypp happens before writing the users config:


2019-04-23 17:27:30 <1> g121(4365) [Pkg] clients/pkg_finish.rb:95 
  Pkg Builtin called: TargetFinish

2019-04-23 17:27:30 <1> g121(4365) [zypp] Repository.cc(eraseFromPool):300 sat::repo(@System){prio -99.0, size 2069} removed from pool
Comment 11 Stefan Hundhammer 2019-04-24 12:14:03 UTC
That last Autologin.supported? is called from here:


2019-04-24 14:07:53 <1> d54(9864) [Ruby] users/ssh_authorized_keyring.rb:124
  Read 0 keys from /root/.ssh/authorized_keys

2019-04-24 14:07:53 <1> d54(9864) [Ruby] modules/Autologin.rb:200
  Autologin.supported? called by

.../modules/Autologin.rb:85:in `Read'
.../yast/yast.rb:204:in `call_yast_function'
.../yast/yast.rb:204:in `block (2 levels) in import'
.../include/users/routines.rb:153:in `setup_all_users'
.../lib/users/clients/users_finish.rb:92:in `write_install'
.../lib/users/clients/users_finish.rb:43:in `write'
.../lib/installation/finish_client.rb:57:in `run'
.../clients/users_finish.rb:31:in `<top (required)>'
.../yast/wfm.rb:318:in `eval'
.../yast/wfm.rb:318:in `run_client'
.../yast/wfm.rb:206:in `call_builtin'
.../yast/wfm.rb:206:in `call_builtin_wrapper'
.../yast/wfm.rb:195:in `CallFunction'
.../lib/installation/clients/inst_finish.rb:119:in `block (2 levels) in write'
.../lib/installation/clients/inst_finish.rb:94:in `each'
.../lib/installation/clients/inst_finish.rb:94:in `each_with_index'
.../lib/installation/clients/inst_finish.rb:94:in `block in write'
.../lib/installation/clients/inst_finish.rb:86:in `each'
.../lib/installation/clients/inst_finish.rb:86:in `each_with_index'
.../lib/installation/clients/inst_finish.rb:86:in `write'
.../lib/installation/clients/inst_finish.rb:66:in `main'
.../clients/inst_finish.rb:2:in `<top (required)>'
.../yast/wfm.rb:318:in `eval'
.../yast/wfm.rb:318:in `run_client'
Comment 12 Stefan Hundhammer 2019-04-24 13:33:49 UTC
Fix for the reopen problem:

  https://github.com/yast/yast-installation/pull/795

will arrive with yast2-installation-4.2.3.
Comment 13 Stefan Hundhammer 2019-04-24 13:51:41 UTC
SR to factory:

https://build.opensuse.org/request/show/697519