View previous topic :: View next topic |
Author |
Message |
zeek Guru
Joined: 16 Nov 2002 Posts: 480 Location: Bantayan Island
|
Posted: Tue Dec 18, 2012 8:02 pm Post subject: lxc - net.ethX requires sysfs, but sysfs disabled in latest |
|
|
Recently it looks like this bug https://bugs.gentoo.org/show_bug.cgi?id=425790 added the keyword '-lxc' to /etc/init.d/sysfs. This prevents sysfs from starting during container boot.
However /etc/init.d/net.lo checks for the existence of network devices using /sys. The relevant snippet:
Code: |
/lib64/rc/net/ifconfig.sh:
_exists()
{
[ -e /sys/class/net/"$IFACE" ]
}
|
Reading the above bug it seems that the submitter is suggesting bind mounting sysfs inside the container? I think that mounting a new instance of sysfs inside the container is more correct than mounting the host's sysfs? Any lxc experts that can comment?
Thanks! |
|
Back to top |
|
|
makton3g Tux's lil' helper
Joined: 19 Aug 2004 Posts: 88
|
Posted: Sat Jan 05, 2013 4:46 pm Post subject: if issue with LXC |
|
|
Zeek
First, THANK YOU!!! I been trying to figure out what has caused my network to die on my guest Gentoo container and your post has put me in the right direction.
for your question, the sysfs is the same regardless where you how many times you mount it and is a security consideration when dealing with LXC containers. You just found a bug in their design for removing sysfs from the container. What was your fix, besides mounting sysfs? I found both spots in the code and am looking to see how I can modify my LXC to bring up the interfaces I'll update if i can can get this work without having sysfs in there.
Again, thanks a bunch!!!
-Mak |
|
Back to top |
|
|
zeek Guru
Joined: 16 Nov 2002 Posts: 480 Location: Bantayan Island
|
Posted: Tue Jan 08, 2013 2:01 am Post subject: |
|
|
The quick n easy solution for now is to use "newnet" USE flag and /etc/conf.d/network file for config (instead of /etc/conf.d/net). This bug report has more details:
https://bugs.gentoo.org/show_bug.cgi?id=445820
If you have a complex network config you might try to modify the init script for net.lo instead.
As pointed out in that bug report newnet seems to be deprecated and will be removed one day:
http://archives.gentoo.org/gentoo-dev/msg_249e5c3f56c10c86bbab3f0d8961aaf3.xml
One more thing, if I compare the results of ls -lR /sys between the host and container I get different results? Do you see identical directory trees? |
|
Back to top |
|
|
|