Quoting Dwight Engen (dwight.en...@oracle.com): > On Mon, 15 Oct 2012 12:42:57 -0500 > Serge Hallyn <serge.hal...@canonical.com> wrote: > > > Quoting Dwight Engen (dwight.en...@oracle.com): > > > This allows a distro to put the distro specific default network > > > configuration (for example bridge device, link type), or other lxc > > > configuration in the case that -f is not passed by the user to > > > lxc-create, in which case lxc-create will use the distro conf file > > > as the basis for the containers config. > > > > I think this is great. Note though that debian does not have an > > lxcbr0, only Ubuntu does. > > Ahh, so what should we use for distro detection? I went looking a bit > and systemd's configure.ac looks for an /etc/os-release but I didn't > find that on any distro I looked at except fedora 17, so I don't > think that will work for older distros. I guess we could use > lsb_release --id?
That would work. Or since /etc/lsb-release on an ubuntu system will contain DISTRIB_ID=Ubuntu you can just do [ -f /etc/lsb-release ] && grep -q DISTRIB_ID=Ubuntu /etc/lsb-release && osname=ubuntu || true > > This is getting "out there", but I wonder if, for the unknown os case, > > it would be reliable to look at the default nic, and check if it is a > > bridge, and use that bridge if so. > > By "default nic" do you mean do something like `brctl show` and use the > first bridge name found? Offhand I was thinking look at the device for 0.0.0.0 route in route -n output (or probably better '^default' in 'ip route' output), then check if it is on a bridge. Not sure if there is a better way. Anyway since distros can override this the empty default is fine. This would be cool, but might be fragile. In my own case my default nic often changes anyway. -serge ------------------------------------------------------------------------------ Don't let slow site performance ruin your business. Deploy New Relic APM Deploy New Relic app performance management and know exactly what is happening inside your Ruby, Python, PHP, Java, and .NET app Try New Relic at no cost today and get our sweet Data Nerd shirt too! http://p.sf.net/sfu/newrelic-dev2dev _______________________________________________ Lxc-devel mailing list Lxc-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/lxc-devel