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

Daniel P. Berrange berrange at redhat.com
Mon Dec 16 08:47:26 PST 2013


On Mon, Dec 16, 2013 at 05:33:12PM +0100, Lennart Poettering wrote:
> On Mon, 16.12.13 12:03, Daniel P. Berrange (berrange at redhat.com) wrote:
> 
> > > 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.
> > 
> > I've tested this with libvirt and it worked except for one small edge
> > case.
> > 
> > Say libvirt creates 3 consoles /dev/pts/0, /dev/pts/1 and /dev/pts/2.
> > Now we set  container_ttys="pts/0 pts/1 pts/2" Systemd starts up 3
> > agetty processes - one of each of these.
> > 
> > The /dev/console device, however, is also a link to /dev/pts/0
> > and so systemd starts up a agetty process for that too.
> > 
> > Now we have 2 agetty processes fighting over /dev/pts/0 which ends
> > in tears
> > 
> > Is this something that systemd should detect & cope with, or should we
> > document that the 'container_ttys' env *must exclude* any tty associated
> > with the /dev/console device ?
> 
> I am tempted to say that we should do the latter, it's quite difficult
> to figure out when they point to the same (for example, because people
> use a bind mount rather than a symlink), and the roles of the console
> and the other $container_ttys is quite different during boot if we want
> to avoid printing logs over the getty and so on...
> 
> I added this to the wiki text now.

Ok, sounds good. I'll update libvirt to take account of this.

Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|


More information about the systemd-devel mailing list