Bug 231099 - getty fails to open /dev/ttyu0
Summary: getty fails to open /dev/ttyu0
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: CURRENT
Hardware: amd64 Any
: --- Affects Some People
Assignee: freebsd-bugs (Nobody)
Depends on:
Reported: 2018-09-02 17:44 UTC by Sean Bruno
Modified: 2018-09-02 18:35 UTC (History)
0 users

See Also:

output of "truss -o /tmp/log /usr/libexec/getty std.115200 ttyu0" (1.93 KB, application/gzip)
2018-09-02 17:57 UTC, Sean Bruno
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sean Bruno freebsd_committer 2018-09-02 17:44:34 UTC
FreeBSD bgp0.ysv.freebsd.org 12.0-ALPHA3 FreeBSD 12.0-ALPHA3 #0 r338350M: Tue Aug 28 17:14:21 UTC 2018     peter@build-12.freebsd.org:/usr/obj/usr/src/sys/CLUSTER12  amd64

After a reboot, the getty attaching to ttyu0 on a few hosts will attach and present a login for administrative purposes.

At some point, and for some unknown reason, getty will exit and init will be unable to restart it.

Sep  2 17:41:58 bgp0 init[9998]: getty repeating too quickly on port /dev/ttyu0, sleeping 30 secs
Sep  2 17:42:28 bgp0 init[10003]: getty repeating too quickly on port /dev/ttyu0, sleeping 30 secs

This happens until a reboot.  I'm unsure if this is due to the console being open by things like conserver or not.

Sending a HUP to init does not restart the getty.

root@bgp0.ysv:/ # ps auwxxx | grep getty
root     1207   0.0  0.1 10844  2424 v0  Is+  Wed15       0:00.00 /usr/libexec/getty Pc ttyv0
root     1208   0.0  0.1 10844  2424 v1  Is+  Wed15       0:00.00 /usr/libexec/getty Pc ttyv1
root     1209   0.0  0.1 10844  2424 v2  Is+  Wed15       0:00.00 /usr/libexec/getty Pc ttyv2
root     1210   0.0  0.1 10844  2424 v3  Is+  Wed15       0:00.00 /usr/libexec/getty Pc ttyv3
root     1211   0.0  0.1 10844  2424 v4  Is+  Wed15       0:00.00 /usr/libexec/getty Pc ttyv4
root     1212   0.0  0.1 10844  2424 v5  Is+  Wed15       0:00.00 /usr/libexec/getty Pc ttyv5
root     1213   0.0  0.1 10844  2424 v6  Is+  Wed15       0:00.00 /usr/libexec/getty Pc ttyv6
root     1214   0.0  0.1 10844  2424 v7  Is+  Wed15       0:00.00 /usr/libexec/getty Pc ttyv7
root    10034   0.0  0.1 11252  2732  0  S+   17:44       0:00.00 grep getty
root@bgp0.ysv:/ # cat /etc/ttys 
# $FreeBSD: head/etc/etc.amd64/ttys 333436 2018-05-09 20:49:00Z imp $
#	@(#)ttys	5.1 (Berkeley) 4/17/89
# This file specifies various information about terminals on the system.
# It is used by several different programs.  Common entries for the
# various columns include:
# name  The name of the terminal device.
# getty The program to start running on the terminal.  Typically a
#       getty program, as the name implies.  Other common entries
#       include none, when no getty is needed, and xdm, to start the
#       X Window System.
# type The initial terminal type for this port.  For hardwired
#      terminal lines, this will contain the type of terminal used.
#      For virtual consoles, the correct type is typically xterm.
#      Other common values include dialup for incoming modem ports, and
#      unknown when the terminal type cannot be predetermined.
# status Must be on or off.  If on, init will run the getty program on
#        the specified port.  If the word "secure" appears, this tty
#        allows root login.
# name	getty				type	status		comments
# If console is marked "insecure", then init will ask for the root password
# when going to single-user mode.
console	none				unknown	off secure
ttyv0	"/usr/libexec/getty Pc"		xterm	onifexists secure
# Virtual terminals
ttyv1	"/usr/libexec/getty Pc"		xterm	onifexists secure
ttyv2	"/usr/libexec/getty Pc"		xterm	onifexists secure
ttyv3	"/usr/libexec/getty Pc"		xterm	onifexists secure
ttyv4	"/usr/libexec/getty Pc"		xterm	onifexists secure
ttyv5	"/usr/libexec/getty Pc"		xterm	onifexists secure
ttyv6	"/usr/libexec/getty Pc"		xterm	onifexists secure
ttyv7	"/usr/libexec/getty Pc"		xterm	onifexists secure
ttyv8	"/usr/local/bin/xdm -nodaemon"	xterm	off secure
# Serial terminals
# The 'dialup' keyword identifies dialin lines to login, fingerd etc.
ttyu0	"/usr/libexec/getty std.115200"	xterm	on secure
ttyu1	"/usr/libexec/getty std.9600"	dialup	off secure
ttyu2	"/usr/libexec/getty std.9600"	dialup	off secure
ttyu3	"/usr/libexec/getty std.9600"	dialup	off secure
# Dumb console
dcons	"/usr/libexec/getty std.9600"	vt100	off secure
Comment 1 Sean Bruno freebsd_committer 2018-09-02 17:57:01 UTC
Created attachment 196798 [details]
output of "truss -o /tmp/log /usr/libexec/getty std.115200 ttyu0"

Note the error on the final write:

sigaction(SIGINT,{ 0x204e40 SA_RESTART ss_t },{ SIG_IGN SA_RESTART ss_t }) = 0 (0x0)
write(1,"\r\nFreeBSD/amd64 (bgp0.ysv.free"...,57) ERR#5 'Input/output error'
Comment 2 Sean Bruno freebsd_committer 2018-09-02 17:57:40 UTC
This system's tty is via uart(4):

uart0: <16550 or compatible> port 0x3f8-0x3ff irq 4 flags 0x10 on acpi0
uart0: console (115200,n,8,1)
Comment 3 Sean Bruno freebsd_committer 2018-09-02 18:35:22 UTC
Issuing a reboot shows that the kernel is able to emit its last console messages to this serial port, which is even more confusing.