globalcitizen / lxc-gentoo

lxc-gentoo: Linux Containers Gentoo Guest Template Script
http://globalcitizen.github.com/lxc-gentoo
GNU General Public License v3.0
86 stars 32 forks source link

Fixed IPv4 and /etc/init.d/net.eth0 #33

Closed PoPoutdoor closed 11 years ago

PoPoutdoor commented 11 years ago

When lxc.network.ipv4 set, /etc/init.d/net.eth0 is not needed. This lead to errors starting up guest eth0.

Please add logic to skip linking net.lo. Related lines:

ln -s net.lo ${ROOTFS}/etc/init.d/net.eth0 ln -s /etc/init.d/net.eth0 ${ROOTFS}/etc/runlevels/default/net.eth0

globalcitizen commented 11 years ago

Added an if there as requested, without testing.

Could you please have a quick test of the latest script, particularly with openrc dependencies that normal daemons have on 'net'? I am not expecting issues but can't test right now.

PoPoutdoor commented 11 years ago

openrc 0.11.5 no longer provide 'net', issues will be gone, if any.

globalcitizen commented 11 years ago

OK. That's good to know. I'd still feel a lot better if you could help me run a quick test with a popular daemon :) Thanks.

PoPoutdoor commented 11 years ago

Here comes the quick test:

Container openrc-0.9.8.4

sshd and lighttpd start without net.eth0 at default runlevel

globalcitizen commented 11 years ago

Thanks again. And good tip on openrc!

PoPoutdoor commented 11 years ago

Do I had bad memory or this is a openrc bug about 'net'?

Container with openrc-0.11.5 needs net.eth0 to provide 'net' , but fails to startup.

Stick to openrc-0.9.8.4 until this resolved.

Info from summary log(openrc-0.11.5):

In this version of OpenRC, the loopback interface no longer satisfies the net virtual. If you have services now which do not start because of this, They can be fixed by adding rc_need="!net" to the /etc/conf.d/ file. You should also file a bug against the service asking that need net be dropped from the dependencies. The bug you file should block the following tracker: https://bugs.gentoo.org/show_bug.cgi?id=439092