Bug 851827

Summary: Can't log in on USB serial console
Product: [Fedora] Fedora Reporter: Chris Adams <linux>
Component: util-linuxAssignee: Karel Zak <kzak>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 17CC: jonathan, kzak, mluscon, rrankin
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-02-01 16:40:22 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Chris Adams 2012-08-26 05:04:34 UTC
I set up a system with a USB serial console (using a PL2303 adapter) by adding to the kernel command line:

  console=tty0 console=ttyUSB0,115200

On system boot, I see the kernel messages and get to a login prompt.  However, when I enter a username and hit return, it just sits there for a few seconds and then goes back to the login prompt.  I get this in /var/log/secure:

Aug 25 23:29:48 vm login: pam_unix(login:auth): conversation failed
Aug 25 23:29:48 vm login: pam_unix(login:auth): auth could not identify password for [cmadams]
Aug 25 23:29:48 vm login: FAILED LOGIN 1 FROM ttyUSB0 FOR cmadams, Authentication failure
Aug 25 23:29:48 vm login: pam_securetty(login:auth): cannot determine username
Aug 25 23:29:48 vm login: pam_succeed_if(login:auth): error retrieving user name: Conversation error
Aug 25 23:29:48 vm login: FAILED LOGIN SESSION FROM ttyUSB0 FOR (unknown), Error in service module

Running strace on the agetty, I see it exec login, but when it gets to printing the "Password:" prompt, the write() call gets EIO (and so does the following read() call trying to get the input).

If I boot the kernel without the serial console, and then just start a getty manually with "systemctl start serial-getty", login works, but of course I don't get the kernel console messages.

I'm not sure if this is a kernel bug or a login bug, but I thought I'd start here first.

Comment 1 Roy Rankin 2012-10-14 11:58:18 UTC
I have also seen this problem in an armv7l system with kernel 3.4.5 and a ch341 usb-tty dongle. This smells like a kernel bug to me, but if I modify login to close 0, 1 and 2 prior to opening ttyUSB0 and then duping 0 to 1 and 2, then login works as expected.

Comment 2 Karel Zak 2012-10-17 10:40:31 UTC
(In reply to comment #1)
> I have also seen this problem in an armv7l system with kernel 3.4.5 and a
> ch341 usb-tty dongle. This smells like a kernel bug to me, but if I modify
> login to close 0, 1 and 2 prior to opening ttyUSB0 and then duping 0 to 1
> and 2, then login works as expected.

Roy, do you mean something like: https://lkml.org/lkml/2012/6/5/145

https://github.com/karelzak/util-linux/commit/2e7035646eb85851171cc2e989bfa858a4f00cd4

This should be supported since util-linux 2.22 (f18).

Comment 3 Roy Rankin 2012-10-17 22:48:01 UTC
Karel, I was closing the 0, 1 and 2 in open_tty so it was after the vhangup.
I have compiled login out of util-linux 2.22 and it works OK on my USB system console port.