I think this is ultimately a LXD issue. Enabling debug logging, I see:
root@r:~# journalctl -u console-getty --since "5s ago"
May 07 13:58:06 r systemd[1]: Started console-getty.service - Console Getty.
May 07 13:58:06 r systemd-executor[964]: Loaded shared library
'libselinux.so.1' via dlopen().
May 07 13:58:06 r (agetty)[964]: console-getty.service: PR_SET_MM_ARG_START
failed: Operation not permitted
May 07 13:58:06 r (agetty)[964]: console-getty.service: KDSETMODE ioctl for
switching to text mode failed on TTY, ignoring: Inappropriate ioctl for device
May 07 13:58:06 r (agetty)[964]: console-getty.service: Failed to reset VT
keyboard, ignoring: Inappropriate ioctl for device
May 07 13:58:06 r (agetty)[964]: console-getty.service: Found container
virtualization lxc.
May 07 13:58:06 r (agetty)[964]: console-getty.service: Failed to get terminal
size by DSR, ignoring: Operation not supported
May 07 13:58:06 r (agetty)[964]: console-getty.service: Resolved /dev/console
to /dev/tty2
May 07 13:58:06 r (agetty)[964]: console-getty.service: Failed to set up
standard input: No such file or directory
May 07 13:58:06 r (agetty)[964]: console-getty.service: Failed at step STDIN
spawning /usr/sbin/agetty: No such file or directory
May 07 13:58:06 r systemd[1]: console-getty.service: Child 964 belongs to
console-getty.service.
May 07 13:58:06 r systemd[1]: console-getty.service: Main process exited,
code=exited, status=208/STDIN (success)
May 07 13:58:06 r systemd[1]: console-getty.service: Deactivated successfully.
May 07 13:58:06 r systemd[1]: console-getty.service: Service will restart
(restart setting)
May 07 13:58:06 r systemd[1]: console-getty.service: Changed running ->
dead-before-auto-restart
May 07 13:58:06 r systemd[1]: console-getty.service: Consumed 5ms CPU time over
334ms wall clock time, 2M memory peak.
May 07 13:58:06 r systemd[1]: console-getty.service: Next restart interval
calculated as: 100ms
May 07 13:58:06 r systemd[1]: console-getty.service: Changed
dead-before-auto-restart -> auto-restart
May 07 13:58:06 r systemd[1]: console-getty.service: Control group is empty.
May 07 13:58:06 r systemd[1]: console-getty.service: Service restart interval
100ms expired, scheduling restart.
May 07 13:58:06 r systemd[1]: console-getty.service: Trying to enqueue job
console-getty.service/start/restart-dependencies
May 07 13:58:06 r systemd[1]: console-getty.service: Installed new job
console-getty.service/start as 4716
The most relevant line is:
May 07 13:58:06 r (agetty)[964]: console-getty.service: Resolved
/dev/console to /dev/tty2
And indeed in the container:
root@r:~# cat /sys/class/tty/console/active
tty0
root@r:~# cat /sys/class/tty/tty0/active
tty2
root@r:~# stat /dev/tty2
stat: cannot stat '/dev/tty2': No such file or directory (os error 2)
The systemd code has some logic to handle /dev/console in containers,
including (a) following /dev/console symlinks, and (b) skipping the
setup if /sys is mounted read-only, as systemd expects containers to
have. But, LXD does not mount /sys read-only. So it seems that this
stuff is leaking in from the host.
** Changed in: systemd (Ubuntu)
Status: New => Incomplete
--
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2150767
Title:
console-getty.service fails on 26.04 LXD image
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/2150767/+subscriptions
--
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs