]> git.ipfire.org Git - thirdparty/lxc.git/commit
mainloop: capture output of short-lived init procs
authorChristian Brauner <christian.brauner@ubuntu.com>
Mon, 25 Dec 2017 13:53:40 +0000 (14:53 +0100)
committerChristian Brauner <christian.brauner@ubuntu.com>
Tue, 26 Dec 2017 10:47:15 +0000 (11:47 +0100)
commit3c319edbb0b139f16ce213041f438c76fa7061fa
tree3d3e57a84cf6a5c230cf863567efeec4fe824522
parenta529bc25cd7d4f80510f01b200d182be4e4815e3
mainloop: capture output of short-lived init procs

The handler for the signal fd will detect when the init process of a container
has exited and cause the mainloop to close. However, this can happen before the
console handlers - or any other events for that matter - are handled. So in the
case of init exiting we still need to allow for all buffered input to the
console to be handled before exiting. This allows us to capture output from
short-lived init processes.

This is conceptually equivalent to my implementation of ExecReaderToChannel()
https://github.com/lxc/lxd/blob/master/shared/util_linux.go#L527

Closes #1694.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/mainloop.c
src/lxc/start.c
src/lxc/start.h