Bug 851827 - Can't log in on USB serial console
Can't log in on USB serial console
Status: CLOSED CURRENTRELEASE
Product: Fedora
Classification: Fedora
Component: util-linux (Show other bugs)
17
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Karel Zak
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-08-26 01:04 EDT by Chris Adams
Modified: 2013-02-01 11:40 EST (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-02-01 11:40:22 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Chris Adams 2012-08-26 01:04:34 EDT
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@ttyUSB0.service", 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 07:58:18 EDT
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 06:40:31 EDT
(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 18:48:01 EDT
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.