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

Lennart Poettering lennart at poettering.net
Fri Dec 13 08:20:19 PST 2013


On Fri, 13.12.13 16:15, Lennart Poettering (lennart at poettering.net) wrote:

> > We had discussed this back at Linux Plumbers last year, and at the time
> > you had suggested that rather than create /dev/ttyN symlinks we should
> > instead do something like  /dev/containerttyN instead, and set a
> > 'container_tty' variable containing a list of all those device names
> > so that systemd can discover them sensibly. We never got around to
> > doing this from the libvirt side, and AFAIK systemd hasn't done anything
> > on its side either. So is this still a suitable way forward ?
> 
> Yeah, I am pretty sure that's what we should do. I figure I should hack
> that up. I'll work on it now.

Committed. "systemd-getty-generator" will now look for $container_ttys
set as an environment variable for PID 1. If that is set it will split
the string up on whitespaces and start a getty on all ptys
referenced. Note that this only supports ptys, not any other ttys. 

Example:

"container_ttys=pts/5 pts/8 pts/15"

when pass to PID 1 will spawn three additional gettys on ptys 5, 8 and
15.

Note that this *really* only supports ptys, not any other kinds of ttys,
sinc for those we require propery device enumeration and notification
and we don't have those in containers... I still chose to name this
$container_ttys rather than $container_ptys, so that maybe one day we
can extend it should devices like this ever get virtualized.

This will be in systemd 209.

Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list