Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
lxc - net.ethX requires sysfs, but sysfs disabled in latest
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
zeek
Guru
Guru


Joined: 16 Nov 2002
Posts: 480
Location: Bantayan Island

PostPosted: Tue Dec 18, 2012 8:02 pm    Post subject: lxc - net.ethX requires sysfs, but sysfs disabled in latest Reply with quote

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
View user's profile Send private message
makton3g
Tux's lil' helper
Tux's lil' helper


Joined: 19 Aug 2004
Posts: 88

PostPosted: Sat Jan 05, 2013 4:46 pm    Post subject: if issue with LXC Reply with quote

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
View user's profile Send private message
zeek
Guru
Guru


Joined: 16 Nov 2002
Posts: 480
Location: Bantayan Island

PostPosted: Tue Jan 08, 2013 2:01 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum