-
close-all-fds: fix behavior · d2cf4c37Serge Hallyn authored
We want to close all inherited fds in three cases - one, if a container is daemonized. Two, if the user specifies -C on the lxc-start command line. Three, in src/lxc/monitor.c. The presence of -C is passed in the lxc_conf may not always exist. One call to lxc_check_inherited was being done from lxc_start(), which doesn't know whether we are daemonized. Move that call to its caller, lxcapi_start(), which does know. Pass an explicit closeall boolean as second argument to lxc_check_inherited. If it is true, then all fds are closed. If it is false, then we check the lxc_conf->close_all_fds. With this, all tests pass, and the logic appears correct. Note that when -C is not true, then we only warn about inherited fds, but we do not abort the container start. This appears to have ben the case since commit 92c7f629 in 2011. Unfortunately the referenced URL with the justification is no longer valid. We may want to consider becoming stricter about this again. (Note that the commit did say "for now") Signed-off-by:
Serge Hallyn <serge.hallyn@ubuntu.com> Acked-by:
Stéphane Graber <stgraber@ubuntu.com>
d2cf4c37
| Name |
Last commit
|
Last update |
|---|---|---|
| .. | ||
| include | Loading commit data... | |
| lua-lxc | Loading commit data... | |
| lxc | Loading commit data... | |
| python-lxc | Loading commit data... | |
| tests | Loading commit data... | |
| Makefile.am | Loading commit data... |