gentoo-add_ip.sh breaks gentoo net startup [message #14223] |
Tue, 19 June 2007 19:08 |
git.user
Messages: 7 Registered: April 2007 Location: Moscow
|
Junior Member |
|
|
G'day
/etc/vz/dists/scripts/gentoo-add_ip.sh of vzctl v3.0.16 has a stupid but rather nasty bug.
short description:
when a function add_ip() looking for the ip(s) to be assigned to vps it use a simple grep for each of the ip(s) in conf.d/net. btw gentoo conf.d/net is some more tricky then just an ip storage, so any presence of ip in this file will breaks a logic thus an ip will not be added to conf.d/net at all.
testcase:
something like
postup() { route add -net 192.168.0.0/16 gw 192.168.1.1 }
preventing of address 192.168.1.1 being added to conf.d/net
I guess, bug itself is stupid and fix is trivial
something like:
- grep -qw "${ip}" ${IFCFG} || \
+ grep -qw "config_${VENET_DEV}=\(.*\"${ip}[\"\/].*\)" ${IFCFG} || \
works for me, so really the questions are:
why we do something _inside_ a guest system from _outside_ at every startup if/when it can be done by guest system itself?
I mean, why we updating i.g. configuration files any time when guest system starting up?
Yes, we should assign some parameters (i.g. ip) to the guest for the first time just because root of the guest can't do this himself, or do every time something what he can't to do but it's only up to guest root to do anything what he want and can to do _after_ startup, nop?
and on the second place wouldn't it be worth to let distro maintainers to provide/maintains scripts like {DISTRO}-add_ip.sh? (though i suspect this proposal may be realized not so easily...)
[Updated on: Wed, 20 June 2007 07:28] Report message to a moderator
|
|
|
Re: gentoo-add_ip.sh breaks gentoo net startup [message #14248 is a reply to message #14223] |
Wed, 20 June 2007 13:12 |
|
Quote: |
why we updating i.g. configuration files any time when guest system starting up?
Yes, we should assign some parameters (i.g. ip) to the guest for the first time just because root of the guest can't do this himself, or do every time something what he can't to do but it's only up to guest root to do anything what he want and can to do _after_ startup, nop?
|
Yea, I like to get answer to this question too (from openvz team of course)
PS: I am Gentoo user too. Last time I tested rhel5-openvz kernels (and in Xen version). My opinion: rhel5-version of openvz is much more suitable for a production usage.
[Updated on: Wed, 20 June 2007 13:13] Report message to a moderator
|
|
|
|
|
|
|
|
|
Re: gentoo-add_ip.sh breaks gentoo net startup [message #14269 is a reply to message #14259] |
Thu, 21 June 2007 05:37 |
|
Quote: |
We want things to "just work", and inside configuration to be in sync with the configuration we have on the node.
|
And what wrong with concept: get config data from VE, change it, and put back? In this case we don't need to setup guest any time we start it...
|
|
|
Re: gentoo-add_ip.sh breaks gentoo net startup [message #14271 is a reply to message #14269] |
Thu, 21 June 2007 06:46 |
git.user
Messages: 7 Registered: April 2007 Location: Moscow
|
Junior Member |
|
|
just bacause u should in most generic case include gentoo baselayout-vserver into vzctl tarball to be sure u get/parsed it correctly. This nothing to do with minimal functionalty provided at first startup it's all about more and more tricky configs. and even worse baselayout already has nothing to do with sysv-init thus nobody in gentoo should takes care to be compatible with the shell at all. It's unlikely but absolutely is not impossible if one day baselayout will be rewriten with hmm... python. what's wrong with python?
[Updated on: Thu, 21 June 2007 07:28] Report message to a moderator
|
|
|