OpenVZ Forum


Home » General » Support » gentoo-add_ip.sh breaks gentoo net startup
gentoo-add_ip.sh breaks gentoo net startup [message #14223] Tue, 19 June 2007 19:08 Go to previous message
git.user is currently offline  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

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: *SOLVED* checkpointing (in backups) sometimes fails
Next Topic: *SOLVED* vzpkgcache leaving directories
Goto Forum:
  


Current Time: Tue Aug 06 08:24:31 GMT 2024

Total time taken to generate the page: 0.03330 seconds