[libvirt] lxc: setsid() usage

Richard Weinberger richard at nod.at
Mon Jun 22 14:40:37 UTC 2015


Hi!

Why is libvirt-lxc issuing a setsid() in lxcContainerSetupFDs()?
To me it seems like a hack to have a controlling TTY if PID 1 is /bin/bash.

If one runs a sysv init style distro (like Debian) in libvirt-lxc the setsid() has
a major downside, when getty spawns a login shell on /dev/tty1 it cannot become
the controlling tty. Hence, if one presses ctrl-c in such a session, the container will
reboot.

Interestingly it does not happen when a systemd distro is used.
Maybe because systemd completely closes and reopens the TTY?

Thanks,
//richard




More information about the libvir-list mailing list