[pkg-lxc-devel] Bug#907615: lxc-console not getting prompt with debian template
peb at debian.org
Fri Jan 11 20:26:48 GMT 2019
Le 11 janvier 2019 21:21:54 GMT+01:00, Alex Mestiashvili <amestia at rsh2.donotuse.de> a écrit :
>On 1/11/19 1:57 PM, Pierre-Elliott Bécue wrote:
>> Hi Alex,
>> Le 11/01/2019 à 10:59, Alex Mestiashvili a écrit :
>>> On 1/10/19 11:52 PM, Pierre-Elliott Bécue wrote:
>>>> Le jeudi 30 août 2018 à 09:58:31+0200, Alex Mestiashvili a écrit :
>>>>> Package: lxc
>>>>> Version: 1:2.0.9-6
>>>>> Severity: normal
>>>>> Steps to reproduce:
>>>>> install lxc, create a container with debian template (backing
>>>>> doesn't matter in this case)
>>>>> lxc-create -n deb2 -t debian -B zfs --zfsroot=ocz/lxc
>>>>> lxc-console -n deb2 -l trace -o console_deb2.lxc.log
>>>> Why using -l, which tend to ruin the interface and hence compromise
>>>> readability of the output?
>>> Well, -l is for the logpriority, that's why it is there. Sorry if
>>> was useless.
>> I'm pretty sorry if I gave you the impression that it was useless. My
>> intent was more to suggest that as this output lacks sufficient
>> you can get rid of it. :)
>No problem at all.
>>> I just gave it another try. And I think I narrowed down the issue
>>> the template.
>> With what version of lxc did you give it another try?
>It's a buster installation with lxc 1:3.1.0-1:
>dpkg -l | perl -lanE '/lxc/ && say $F,"\t",$F'
>>> When attaching to a newly created debian container (lxc-create -t
>>> debian) with lxc-attach -n <container> I can see that there is only
>>> console and no ttys are spawned:
>>> root at deb2:/etc# ps -ef | grep agetty
>>> root 73 1 0 09:42 console 00:00:00 /sbin/agetty
>>> --keep-baud console 115200,38400,9600 vt220
>>> While in an ubuntu template there are 1 console and 4 pts:
>>> ps -ef | grep agetty
>>> root 102 1 0 08:58 pts/0 00:00:00 /sbin/agetty
>>> --keep-baud pts/0 115200 38400 9600 vt220
>>> root 103 1 0 08:58 console 00:00:00 /sbin/agetty
>>> --keep-baud console 115200 38400 9600 vt220
>>> root 104 1 0 08:58 pts/3 00:00:00 /sbin/agetty
>>> --keep-baud pts/3 115200 38400 9600 vt220
>>> root 105 1 0 08:58 pts/1 00:00:00 /sbin/agetty
>>> --keep-baud pts/1 115200 38400 9600 vt220
>>> root 106 1 0 08:58 pts/2 00:00:00 /sbin/agetty
>>> --keep-baud pts/2 115200 38400 9600 vt220
>>> So my initial bug report wasn't exactly correct.
>>> One can get login prompt on container created with debian template,
>>> only by calling lxc-console -n <container> -t 0
>>> This "-t 0" is not obvious and I can imagine some people don't know
>>> about it.
>>> lxc and lxc-console are totally ok. It's the debian template with
>>> systemd which is by default have a not optimal setup.
>>> No idea how to fix that, spent some time, but lost in systemd
>>> crosslinked docs.
>> This is interesting, but I'm surprised, I'm not meeting such an
>> my Debian containers work perfectly fine.
>> Do you get any message? Can you use trace on lxc-create and log all
>> this in a file?
>I've got another box with up-to-date debian buster installed.
>Installed lxc with apt-get install lxc (lxc 1:3.1.0-1, lxc-templates
>3.0.3-1) created a new container with this command:
>lxc-create -t debian -n test1
>after that started the container:
>lxc-start -dn test1
>tried to lxc-console to the container:
>lxc-console -n test1
>Connected to tty 1
>Type <Ctrl+a q> to exit the console, <Ctrl+a Ctrl+a> to enter Ctrl+a
>Not getting prompt, however lxc-console -n test1 -t 0 does give a
>lxc-attach with ps -ef:
>lxc-attach -n test1
>root at test1:~# ps -ef
>UID PID PPID C STIME TTY TIME CMD
>root 1 0 0 19:54 ? 00:00:00 /sbin/init
>root 36 1 0 19:54 ? 00:00:00
>root 76 1 0 19:54 pts/2 00:00:00 /sbin/agetty --noclear
>--keep-baud console 115200,38400,9600 vt220
>root 77 1 0 19:54 ? 00:00:00 /usr/sbin/sshd -D
>root 79 0 0 20:06 pts/3 00:00:00 /bin/bash
>So the issue is reproducible on a testing system.
>When creating a container with -l trace I just get this:
>lxc-create -l debug -o /tmp/lxc-create_debian.txt -t debian -n test5
>lxc-create test7 20190111201044.860 DEBUG storage -
>storage/storage.c:get_storage_by_name:231 - Detected rootfs type "dir"
>The same issue I observe with a sid container on another Debian buster
>installation, only 1 aggety instance listening on console - t 0.
Is this issue occurring with root or unpriviledged containers ?
PEB from my phone.
More information about the Pkg-lxc-devel