/sbin/mingetty : tty[1-6]: No such file or directory

PROBLEM SUMMARY:

/sbin/mingetty respawning failing and filling up /var/log/messages very quickly.
No /dev/ttyN created.
Creating /dev/tty[1-6] with ‘mknod 666 /dev/ttyN c 5 N’ for N=1…6 and ‘telinit q’ did not fix

TROUBLESHOOTING:

  • Several issues all over with broken mingetty processes on various distros and kernels.
  • Notes on needing setsid needed regarding ‘controlling tty’ issues
  • Attempted to remove all the ‘respawn’ and comment out stuff in /etc/init/[start-ttys.conf, ttys.conf, serial.conf] and restart init with no joy
  • Attempted to edit and uncomment line ‘ACTIVE_CONSOLES=/dev/tty[1-6]’ in /etc/sysconfig/init and ‘telinit q’ or ‘kill -HUP 1’ with no joy

CONTAINER LOGS:
bash-4.1# grep tty /var/log/messages | tail
Jul 5 22:52:50 nk11p07mm-monitorm002 /sbin/mingetty[7553]: tty[1-6]: No such file or directory
Jul 5 22:52:55 nk11p07mm-monitorm002 init: tty (/dev/tty[1-6]) main process (7553) terminated with status 1
Jul 5 22:52:55 nk11p07mm-monitorm002 init: tty (/dev/tty[1-6]) main process ended, respawning
Jul 5 22:52:55 nk11p07mm-monitorm002 /sbin/mingetty[7558]: tty[1-6]: No such file or directory
Jul 5 22:53:00 nk11p07mm-monitorm002 init: tty (/dev/tty[1-6]) main process (7558) terminated with status 1
Jul 5 22:53:00 nk11p07mm-monitorm002 init: tty (/dev/tty[1-6]) main process ended, respawning
Jul 5 22:53:00 nk11p07mm-monitorm002 /sbin/mingetty[7561]: tty[1-6]: No such file or directory
Jul 5 22:53:05 nk11p07mm-monitorm002 init: tty (/dev/tty[1-6]) main process (7561) terminated with status 1
Jul 5 22:53:05 nk11p07mm-monitorm002 init: tty (/dev/tty[1-6]) main process ended, respawning
Jul 5 22:53:05 nk11p07mm-monitorm002 /sbin/mingetty[7566]: tty[1-6]: No such file or directory

bash-4.1# ls -l /dev/tty*
crw-rw-rw- 1 root root 5, 0 Jul 5 21:42 /dev/tty

DOCKER HOST:
root # rpm -qa | grep docker
docker-io-1.7.1-2.el6.x86_64

root # docker info
Containers: 1
Images: 107
Storage Driver: devicemapper
Pool Name: docker-252:0-2624794-pool
Pool Blocksize: 65.54 kB
Backing Filesystem: extfs
Data file: /dev/loop0
Metadata file: /dev/loop1
Data Space Used: 3.041 GB
Data Space Total: 107.4 GB
Data Space Available: 45.88 GB
Metadata Space Used: 5.509 MB
Metadata Space Total: 2.147 GB
Metadata Space Available: 2.142 GB
Udev Sync Supported: true
Deferred Removal Enabled: false
Data loop file: /var/lib/docker/devicemapper/devicemapper/data
Metadata loop file: /var/lib/docker/devicemapper/devicemapper/metadata
Library Version: 1.02.117-RHEL6 (2016-12-13)
Execution Driver: native-0.2
Logging Driver: json-file
Kernel Version: 3.8.13-118.17.4.el6uek.x86_64
Operating System: Oracle Linux Server 6.9
CPUs: 24
Total Memory: 70.79 GiB
Name: vp21q11im-hpaf07102101.me.com
ID: XBBS:IUTT:CJVW:L6Z5:CFZR:LXAB:RRJK:I3UD:B3ML:MLT3:BDS3:KPRV

DOCKER CONTAINER:

bash-4.1# uname -a
Linux vp21q11im-hpaf07102101.me.com 3.8.13-118.17.4.el6uek.x86_64 #2 SMP Wed Mar 29 17:34:55 PDT 2017 x86_64 x86_64 x86_64 GNU/Linux

bash-4.1# cat /etc/issue
Oracle Linux Server release 6.9

bash-4.1# cat /etc/inittab

inittab is only used by upstart for the default runlevel.

ADDING OTHER CONFIGURATION HERE WILL HAVE NO EFFECT ON YOUR SYSTEM.

System initialization is started by /etc/init/rcS.conf

Individual runlevels are started by /etc/init/rc.conf

Ctrl-Alt-Delete is handled by /etc/init/control-alt-delete.conf

Terminal gettys are handled by /etc/init/tty.conf and /etc/init/serial.conf,

with configuration in /etc/sysconfig/init.

For information on how to write upstart event handlers, or how

upstart works, see init(5), init(8), and initctl(8).

Default runlevel. The runlevels used are:

0 - halt (Do NOT set initdefault to this)

1 - Single user mode

2 - Multiuser, without NFS (The same as 3, if you do not have networking)

3 - Full multiuser mode

4 - unused

5 - X11

6 - reboot (Do NOT set initdefault to this)

id:3:initdefault:

bash-4.1# cat /etc/init/start-ttys.conf

This service starts the configured number of gettys.

Do not edit this file directly. If you want to change the behaviour,

please create a file start-ttys.override and put your changes there.

start on stopped rc RUNLEVEL=[2345]

env ACTIVE_CONSOLES=/dev/tty[1-6]
env X_TTY=/dev/tty1
task
script
. /etc/sysconfig/init
for tty in $(echo $ACTIVE_CONSOLES) ; do
[ “$RUNLEVEL” = “5” -a “$tty” = “$X_TTY” ] && continue
initctl start tty TTY=$tty
done
end script
bash-4.1# cat /etc/init/tty.conf

tty - getty

This service maintains a getty on the specified device.

Do not edit this file directly. If you want to change the behaviour,

please create a file tty.override and put your changes there.

stop on runlevel [S016]

respawn
instance $TTY
exec /sbin/mingetty $TTY
usage ‘tty TTY=/dev/ttyX - where X is console id’
bash-4.1# cat /etc/init.d/serial.conf
cat: /etc/init.d/serial.conf: No such file or directory
bash-4.1# cat /etc/init/serial.conf

Automatically start a configured serial console

How this works:

On boot, a udev helper examines /dev/console. If a serial console is the

primary console (last console on the commandline in grub), the event

‘fedora.serial-console-available ’ is emitted, which

triggers this script. It waits for the runlevel to finish, ensures

the proper port is in /etc/securetty, and starts the getty.

If your serial console is not the primary console, or you want a getty

on serial even if it’s not the console, create your own event e.g.

/etc/init/ttyS0.conf with content:

# ttyS0 - agetty

# This service maintains a agetty on ttyS0.

stop on runlevel [S016]

start on runlevel [23]

respawn

exec agetty -h -L -w /dev/ttyS0 115200 vt102

Do not edit this file directly. If you want to change the behaviour,

please create a file serial.override and put your changes there.

start on fedora.serial-console-available DEV=* and stopped rc RUNLEVEL=[2345]
stop on runlevel [S016]

instance $DEV
respawn
pre-start exec /sbin/securetty $DEV
exec /sbin/agetty /dev/$DEV $SPEED vt100-nav
post-stop exec /sbin/initctl emit --no-wait fedora.serial-console-available DEV=$DEV SPEED=$SPEED
usage ‘DEV=ttySX SPEED=Y - where X is console id and Y is baud rate’

crw-rw-rw- 1 root root 5, 0 Jul 5 18:50 /dev/tty