Only use bridge if available to prevent container startup failures
LXC doesn't start the container when the configured network interface (the bridge in this case) is not available.
This commit is contained in:
parent
cb9814fb02
commit
b31d79ca08
1 changed files with 5 additions and 3 deletions
|
|
@ -113,9 +113,11 @@ void LxcContainer::start(const Configuration &configuration) {
|
|||
"lxc.logfile",
|
||||
utils::string_format("%s/container.log", config::log_path()).c_str());
|
||||
|
||||
set_config_item("lxc.network.type", "veth");
|
||||
set_config_item("lxc.network.flags", "up");
|
||||
set_config_item("lxc.network.link", "anboxbr0");
|
||||
if (fs::exists("/sys/class/net/anboxbr0")) {
|
||||
set_config_item("lxc.network.type", "veth");
|
||||
set_config_item("lxc.network.flags", "up");
|
||||
set_config_item("lxc.network.link", "anboxbr0");
|
||||
}
|
||||
|
||||
#if 0
|
||||
// Android uses namespaces as well so we have to allow nested namespaces for LXC
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue