Bug 872628
Summary: | List available LXC consoles using container_ttys env variable | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 7 | Reporter: | Daniel Berrangé <berrange> |
Component: | libvirt | Assignee: | Daniel Berrangé <berrange> |
Status: | CLOSED ERRATA | QA Contact: | Virtualization Bugs <virt-bugs> |
Severity: | unspecified | Docs Contact: | |
Priority: | unspecified | ||
Version: | 7.0 | CC: | ajia, cwei, dwalsh, dyuan, jdenemar, mzhan, yanyang |
Target Milestone: | rc | ||
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | libvirt-1.2.7-1.el7 | Doc Type: | Bug Fix |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2015-03-05 07:19:40 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Daniel Berrangé
2012-11-02 15:48:02 UTC
Support is in systemd upstream now (will be in systemd 209) http://cgit.freedesktop.org/systemd/systemd/commit/?id=1d97ff7dd71902a5604c2fed8964925d54e09de9 And proposed for libvirt https://www.redhat.com/archives/libvir-list/2013-December/msg00829.html commit daf08f36b525dc9e0f8469ee29ea9ebfd3aa860e Author: Daniel P. Berrange <berrange> Date: Fri Dec 13 16:50:28 2013 +0000 Set the 'container_ttys' env variable for LXC consoles Systemd specified that any /dev/pts/NNN device on which it is expected to spawn a agetty login, should be listed in the 'container_ttys' env variable. It should just contain the relative paths, eg 'pts/0' not '/dev/pts/0' and should be space separated. http://cgit.freedesktop.org/systemd/systemd/commit/?id=1d97ff7dd71902a5604c2fed8964925d54e09de9 Signed-off-by: Daniel P. Berrange <berrange> Fixed upstream by v1.2.0-155-gdaf08f3. Thanks Daniel a lot. I'd like to verify it on the following version libvirt-1.2.8-5.el7.x86_64 systemd-208-14.el7.x86_64 Steps: 1. define/start a lxc with multiple console # cat lxc.xml <domain type='lxc'> <name>lxc-test</name> <memory unit='KiB'>1048576</memory> <currentMemory unit='KiB'>1048576</currentMemory> <vcpu placement='static'>1</vcpu> <os> <type arch='x86_64'>exe</type> <init>/bin/sh</init> </os> <clock offset='utc'> <timer name='rtc' tickpolicy='catchup'/> <timer name='pit' tickpolicy='delay'/> <timer name='hpet' present='no'/> </clock> <on_poweroff>destroy</on_poweroff> <on_reboot>restart</on_reboot> <on_crash>restart</on_crash> <devices> <emulator>/usr/libexec/libvirt_lxc</emulator> <interface type='network'> <mac address='52:54:00:8f:13:eb'/> <source network='default'/> </interface> <console type='pty'> <target type='lxc' port='0'/> </console> <console type='pty'> <target type='serial' port='1'/> </console> <console type='pty'> <target type='lxc' port='2'/> </console> <console type='pty'> <target type='lxc' port='3'/> </console> </devices> </domain> # virsh -c lxc:/// define lxc.xml Domain lxc-test defined from lxc.xml # virsh -c lxc:/// start lxc-test Domain lxc-test started 2. conneting to lxc console and check env variable *container_ttys* # virsh -c lxc:/// console lxc-test Connected to domain lxc-test Escape character is ^] sh-4.2# env TERM=linux container_ttys=pts/1 pts/2 pts/3 PATH=/bin:/sbin PWD=/ container_uuid=c5ae31a2-f950-4f26-8272-9c67636a3575 SHLVL=1 LIBVIRT_LXC_UUID=c5ae31a2-f950-4f26-8272-9c67636a3575 LIBVIRT_LXC_NAME=lxc-test container=lxc-libvirt _=/bin/env sh-4.2# ls /dev/tty* -l crw-rw-rw-. 1 root root 5, 0 Oct 21 14:26 /dev/tty lrwxrwxrwx. 1 root root 10 Oct 21 14:26 /dev/tty1 -> /dev/pts/0 lrwxrwxrwx. 1 root root 10 Oct 21 14:26 /dev/tty2 -> /dev/pts/1 lrwxrwxrwx. 1 root root 10 Oct 21 14:26 /dev/tty3 -> /dev/pts/2 lrwxrwxrwx. 1 root root 10 Oct 21 14:26 /dev/tty4 -> /dev/pts/3 3. clean env and define/start a lxc with one console # cat lxc.xml <domain type='lxc'> <name>lxc-test</name> <memory unit='KiB'>1048576</memory> <currentMemory unit='KiB'>1048576</currentMemory> <vcpu placement='static'>1</vcpu> <os> <type arch='x86_64'>exe</type> <init>/bin/sh</init> </os> <clock offset='utc'> <timer name='rtc' tickpolicy='catchup'/> <timer name='pit' tickpolicy='delay'/> <timer name='hpet' present='no'/> </clock> <on_poweroff>destroy</on_poweroff> <on_reboot>restart</on_reboot> <on_crash>restart</on_crash> <devices> <emulator>/usr/libexec/libvirt_lxc</emulator> <interface type='network'> <mac address='52:54:00:8f:13:eb'/> <source network='default'/> </interface> <console type='pty'> <target type='lxc' port='0'/> </console> </devices> </domain> # virsh -c lxc:/// define lxc.xml Domain lxc-test defined from lxc.xml # virsh -c lxc:/// start lxc-test Domain lxc-test started 4. conneting to the lxc console and check env variable *container_ttys* does not exist # virsh -c lxc:/// console lxc-test Connected to domain lxc-test Escape character is ^] sh-4.2# env TERM=linux PATH=/bin:/sbin PWD=/ container_uuid=7b48ee47-2e0e-4f72-920c-29ac38d553c4 SHLVL=1 LIBVIRT_LXC_UUID=7b48ee47-2e0e-4f72-920c-29ac38d553c4 LIBVIRT_LXC_NAME=lxc-test container=lxc-libvirt _=/bin/env sh-4.2# ls /dev/tty* -l crw-rw-rw-. 1 root root 5, 0 Oct 21 15:07 /dev/tty lrwxrwxrwx. 1 root root 10 Oct 21 15:07 /dev/tty1 -> /dev/pts/0 sh-4.2# Since above steps got the expected results, set it to verified status Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://rhn.redhat.com/errata/RHSA-2015-0323.html |