[systemd-devel] getty : how to run getty on every ttyX

Lennart Poettering lennart at poettering.net
Fri Dec 13 08:24:34 PST 2013


On Fri, 13.12.13 15:20, Daniel P. Berrange (berrange at redhat.com) wrote:

> 
> On Fri, Dec 13, 2013 at 04:15:33PM +0100, Lennart Poettering wrote:
> > On Fri, 13.12.13 15:12, Daniel P. Berrange (berrange at redhat.com) wrote:
> > 
> > > > /dev/tty1, /dev/tty2, ... make no sense in containers as there is no
> > > > virtual console. 
> > > 
> > > For each <console> device that you list in the container configuration
> > > with libvirt, it will allocate a /dev/pts/NNN device, and add a symlink
> > > from /dev/ttyN to the /dev/pts/NNN slave.  What we'd like is for guest
> > > OS to be able to setup  agetty processes on any <console> device libvirt
> > > has configured for the container automatically.
> > 
> > Humm, I'd prefer if you wouldn't create such symlinks, as it suggests
> > those devices would actually be full VT devices, but they aren't, they
> > speak a different $TERM and have no matching /dev/vcsa stuff and don't
> > speak the ioctls....
> 
> Basically I agree, but libvirt has to figure out its back-compat
> story here so we don't break existing deployments of libvirt
> containers which might be relying this. Now that I remember,
> figuring out the backcompat story is in fact what stopped me
> implementing the better idea so far....

So from the systemd side of things it's probably fine to leave those
symlinks in, as we won't look at them. We check for existance of
/dev/tty0 to figure out whether the VT subsystem exists or not in the
environment we run it. If that's missing we will ignore the VT stuff
entirely and it doesn't matter anymore that it is fake...

As long as you don't create fake symlinks for /dev/tty0, too we hence
don't mind if you create /dev/tty1, /dev/tty2, ... symlinks...

A simple approach for you might be to allocate a couple of ptys, specify
those in $container_ttys, and then if legacy compat is desired also
symlink them. That way, systemd will work fine, and so will legacy stuff
that looks for fake /dev/tty1, ... links...

Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list