[pkg-lxc-devel] Bug#907615: tty0 missing
support-debian at volo.net
support-debian at volo.net
Sat Jan 25 15:10:51 GMT 2020
This is happening because /dev/tty0 doesn't exist:
root at vs5:/home/volo# lxc-start -n speedtest
root at vs5:/home/volo# lxc-attach -n speedtest
root at speedtest:/# exit
exit
root at vs5:/home/volo# lxc-console -n speedtest
Connected to tty 1
Type <Ctrl+a q> to exit the console, <Ctrl+a Ctrl+a> to enter Ctrl+a itself
<Ctrl+a q>
root at vs5:/home/volo# lxc-attach -n speedtest
root at speedtest:/# systemctl status getty at tty1.service
● getty at tty1.service - Getty on tty1
Loaded: loaded (/lib/systemd/system/getty at .service; enabled; vendor preset: enabled)
Active: inactive (dead)
Condition: start condition failed at Sat 2020-01-25 10:46:07 UTC; 40s ago
└─ ConditionPathExists=/dev/tty0 was not met
Docs: man:agetty(8)
man:systemd-getty-generator(8)
http://0pointer.de/blog/projects/serial-console.html
Jan 25 10:46:07 speedtest systemd[1]: Condition check resulted in Getty on tty1 being skipped.
root at speedtest:/# mknod /dev/tty0 c 4 0
root at speedtest:/# systemctl restart getty at tty1.service
root at speedtest:/# systemctl status getty at tty1.service
● getty at tty1.service - Getty on tty1
Loaded: loaded (/lib/systemd/system/getty at .service; enabled; vendor preset: enabled)
Active: active (running) since Sat 2020-01-25 10:47:11 UTC; 2s ago
Docs: man:agetty(8)
man:systemd-getty-generator(8)
http://0pointer.de/blog/projects/serial-console.html
Main PID: 83 (agetty)
Tasks: 1 (limit: 4915)
Memory: 352.0K
CGroup: /system.slice/system-getty.slice/getty at tty1.service
└─83 /sbin/agetty -o -p -- \u --noclear tty1 linux
Jan 25 10:47:11 speedtest systemd[1]: Started Getty on tty1.
root at speedtest:/# exit
exit
root at vs5:/home/volo# lxc-console -n speedtest
Connected to tty 1
Type <Ctrl+a q> to exit the console, <Ctrl+a Ctrl+a> to enter Ctrl+a itself
Debian GNU/Linux bullseye/sid speedtest tty1
speedtest login:
<Ctrl+a q>
I used lxc.hook.autodev to create tty0 and that fixes the symptom but not the problem:
root at vs5:/home/volo# grep autodev /var/lib/lxc/speedtest/config
lxc.hook.autodev = /var/lib/lxc/speedtest/devhook
root at vs5:/home/volo# cat /var/lib/lxc/speedtest/devhook
#!/bin/sh
mknod ${LXC_ROOTFS_MOUNT}/dev/tty0 c 4 0
root at vs5:/home/volo# lxc-start -n speedtest
root at vs5:/home/volo# lxc-console -n speedtest
Connected to tty 1
Type <Ctrl+a q> to exit the console, <Ctrl+a Ctrl+a> to enter Ctrl+a itself
Debian GNU/Linux bullseye/sid speedtest tty1
speedtest login: root
Password:
Linux speedtest 4.19.0-6-amd64 #1 SMP Debian 4.19.67-2+deb10u1 (2019-09-20) x86_64
The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Sat Jan 25 14:41:04 UTC 2020 on console
root at speedtest:~# ls -l /dev/{console,tty,tty0,tty1}
crw--w---- 1 root tty 136, 4 Jan 25 14:51 /dev/console
crw-rw-rw- 1 root root 5, 0 Jan 25 14:51 /dev/tty
crw-r--r-- 1 root root 4, 0 Jan 25 14:51 /dev/tty0
crw------- 1 root tty 136, 0 Jan 25 15:03 /dev/tty1
Compare that to the host:
root at vs5:/home/volo# ls -l /dev/{console,tty,tty0,tty1}
crw------- 1 root root 5, 1 Jan 24 18:47 /dev/console
crw-rw-rw- 1 root tty 5, 0 Jan 25 08:38 /dev/tty
crw--w---- 1 root tty 4, 0 Jan 24 18:47 /dev/tty0
crw------- 1 volo tty 4, 1 Jan 24 18:47 /dev/tty1
I think I could have used touch /dev/tty0 instead of mknod and it would
have had the same effect. I also saw systemd-getty-generator in the
systemctl output, which seems relevant, and discusses
container-getty at X.service, but:
root at speedtest:~# systemctl status container-getty at 0.service
● container-getty at 0.service - Container Getty on /dev/pts/0
Loaded: loaded (/lib/systemd/system/container-getty at .service; enabled; vendor preset: enabled)
Active: inactive (dead)
Docs: man:agetty(8)
man:systemd-getty-generator(8)
man:machinectl(1)
Hopefully someone knows where to go from here...
Peter
More information about the Pkg-lxc-devel
mailing list