Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 324419 - sys-apps/shadow-4.1.3.1: autologin fails with login
Summary: sys-apps/shadow-4.1.3.1: autologin fails with login
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: AMD64 Linux
: High minor (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-17 03:01 UTC by Frank Peters
Modified: 2014-11-04 17:34 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge --info (emerge.info,3.02 KB, text/plain)
2010-06-18 17:24 UTC, Frank Peters
Details
Build log for shadow-4.1.4.2-r3 (shadow-4.1.4.2-r3.log,106.82 KB, text/plain)
2010-06-18 17:30 UTC, Frank Peters
Details
Output of strace (strace.log,28.72 KB, text/plain)
2010-11-16 21:52 UTC, Frank Peters
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Frank Peters 2010-06-17 03:01:42 UTC
The following URL describes a method for an autologin to a Linux machine:

http://www.gentoo-wiki.info/TIP_Passwordless_Login

This autologin method fails with the login program from shadow packages that are greater than 4.1.3.1.  Using any shadow package 4.1.4 and higher will cause the machine to hang when using the autologin method.  Shadow packages 4.1.3.1 and lower will allow the autologin method to succeed as desribed in the wiki article.

This obviously is an upstream issue because several changes have been made to the login source code by the developers.  However, I thought it would be best to report this issue here because the wiki article is based on a Gentoo forum post and other Gentoo users will experience the same problem if they choose to autologin to their machines using this method.


Reproducible: Always

Steps to Reproduce:
1. Use any ebuild of shadow greater than 4.1.3.1
2. Change inittab and other files according to the method in the wiki article
3. Reboot the machine

Actual Results:  
The machine, instead of automatically logging on, will hang.  No messages of any kind are reported or logged.



I traced the issue to a specific shadow version number by compiling the sources taken from this location:

ftp://pkg-shadow.alioth.debian.org/pub/pkg-shadow

I had to compile the source myself becaue the ebuilds available in the current portage tree do not include every shadow release.
Comment 1 SpanKY gentoo-dev 2010-06-18 13:28:55 UTC
you need to post `emerge --info` and a full build log as an attachment just like every bug report says to
Comment 2 Frank Peters 2010-06-18 17:24:28 UTC
Created attachment 235873 [details]
emerge --info
Comment 3 Frank Peters 2010-06-18 17:30:58 UTC
Created attachment 235877 [details]
Build log for shadow-4.1.4.2-r3
Comment 4 Frank Peters 2010-06-18 17:43:09 UTC
The problem was first noticed when I attempted to autologin using the login form the latest shadow-4.1.4.2 ebuild.  The system hanged at the login process.

To reclaim my machine, I had to boot using a backup system which contained an earlier version of the shadow package.  Using login from this earlier package allowed the autologin method to be successful.  My suspicion was that the login source code has been altered in the newer versions, and this is supported by the Changelog information.  How these changes affect autologin I don't understand. 

But to pinpoint the exact version where the autologin failure first occurred, I compiled all versions of shadow taken from the Debian site.  Gentoo portage does not have all prior versions of shadow as ebuilds.  Autologin fails beginning with shadow-4.1.4.

As I mentioned, this is likely an upstream issue, but since I use Gentoo I thought I'd report the problem here.

I have two machines running Gentoo and the problem occurs with both.
Comment 5 SpanKY gentoo-dev 2010-06-20 01:01:00 UTC
i'm wondering if it's only an issue when USE=-pam
Comment 6 SpanKY gentoo-dev 2010-11-16 11:34:20 UTC
does this only happen when running from /etc/inittab ?  if you login as root and then manually execute:
  login -f <user>

does it work ?  this works for me on USE=pam and USE=-pam ...
Comment 7 Frank Peters 2010-11-16 16:39:31 UTC
(In reply to comment #6)
> does this only happen when running from /etc/inittab ?  if you login as root
> and then manually execute:
>   login -f <user>

Yes, it seems to happen only when login is executed from /etc/inittab, or actually a script called from inittab as described in the wiki page.

Manually executing "login -f <user>" causes the login program to hang.  There is no response or log messages and only with Ctl-C can I regain control.  However, using the older version of login (4.1.3.1) will allow the manual login command to complete normally.

There is a new twist.  Trying the autologin using login from the latest Gentoo shadow-4.1.4.2-r6, init now reports the following:

Id "1" respawning too fast; disabling for 5 minutes

ID "1" refers to the autologin entry in inittab, and it seems that login fails to execute at all.

Until I can do some further debugging, I'll have to keep using the login from shadow-4.1.3.1.
Comment 8 Frank Peters 2010-11-16 16:43:35 UTC
(In reply to comment #7)
> 
> Yes, it seems to happen only when login is executed from /etc/inittab, or
> actually a script called from inittab as described in the wiki page.
> 

I'm sorry.  I used the wrong words.  Here is what I should have wrote:

No, it happens even when I manually execute the "login -f <user>"
command. 
Comment 9 SpanKY gentoo-dev 2010-11-16 17:55:36 UTC
the init behavior isnt really anything new.  if a process launches and exits immediately over and over, then it'll stop trying to respawn it.

run the login process through strace:
  strace -f -s 4096 -o log login -f <user>
then post that "log" file as an attachment

you might also want to try dropping the "-mfpmath=sse -mssse3 -m128bit-long-double" crap from your CFLAGS and rebuilding glibc/cracklib/zlib/shadow to see if it makes a difference.
Comment 10 Frank Peters 2010-11-16 21:51:12 UTC
(In reply to comment #9)
 
> run the login process through strace:
>   strace -f -s 4096 -o log login -f <user>
> then post that "log" file as an attachment

The log file, strace.log, is uploaded.

The last two lines result from stopping the process with Ctl-C after a few minutes.
Comment 11 Frank Peters 2010-11-16 21:52:03 UTC
Created attachment 254545 [details]
Output of strace
Comment 12 SpanKY gentoo-dev 2010-11-19 08:55:08 UTC
you've got quite a bit of stuff changed from the default in /etc/login.defs.  but it seems like it's your CONSOLE setting which is screwing things up.  try setting it back to the default of /etc/securetty.
Comment 13 Frank Peters 2010-11-19 16:38:51 UTC
(In reply to comment #12)
> but it seems like it's your CONSOLE setting which is screwing things up.  try
> setting it back to the default of /etc/securetty.
> 

That fixes it.  Changing the setting to "/etc/securetty" now allows the autologin procedure to work.

The configuration was the fault, but is this issue still to be considered a bug?  The previous versions of login did not fail when reading the same configuration file.
Comment 14 Frank Peters 2010-11-19 22:35:27 UTC
I also reported this issue to the Debian shadow maintainers.  Based on the information in this Gentoo report, they have identified the source of the problem:

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=600755

A bug in the CONSOLE parser code was introduced in shadow-4.1.4, which will be fixed shortly.
Comment 15 SpanKY gentoo-dev 2014-11-04 17:34:19 UTC
should be fixed in the versions we have in the tree now