Bug 851827 - Can't log in on USB serial console
Summary: Can't log in on USB serial console
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: util-linux
Version: 17
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Karel Zak
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-08-26 05:04 UTC by Chris Adams
Modified: 2013-02-01 16:40 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-02-01 16:40:22 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

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.


Note You need to log in before you can comment on or make changes to this bug.