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 next 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

Re: gentoo-add_ip.sh breaks gentoo net startup [message #14248 is a reply to message #14223] Wed, 20 June 2007 13:12 Go to previous messageGo to next message
seyko2 is currently offline  seyko2
Messages: 188
Registered: February 2007
Location: Moscow
Senior Member

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 Smile (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 #14257 is a reply to message #14223] Wed, 20 June 2007 15:30 Go to previous messageGo to next message
kir is currently offline  kir
Messages: 1645
Registered: August 2005
Location: Moscow, Russia
Senior Member

Thanks, I have committed the patch to git:
http://git.openvz.org/?p=vzctl;a=commit;h=695ebe56ca59d3380942d9db91b360f052e8758e


Kir Kolyshkin
http://static.openvz.org/userbars/openvz-developer.png
Re: gentoo-add_ip.sh breaks gentoo net startup [message #14259 is a reply to message #14223] Wed, 20 June 2007 15:35 Go to previous messageGo to next message
kir is currently offline  kir
Messages: 1645
Registered: August 2005
Location: Moscow, Russia
Senior Member

Quote:

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?


We want things to "just work", and inside configuration to be in sync with the configuration we have on the node.

In general, if you need lower level functionality, try to deal with libvzctl -- perhaps it also needs pieces to be separated out but I guess it's a better way to start (than from scratch). One can hack a handful of low-level utils on top of libvzctl -- like ubctl for UBC, fsctl for fair scheduler etc. -- the same way it's separated out for vzquota.


Kir Kolyshkin
http://static.openvz.org/userbars/openvz-developer.png
Re: gentoo-add_ip.sh breaks gentoo net startup [message #14262 is a reply to message #14259] Wed, 20 June 2007 19:34 Go to previous messageGo to next message
git.user is currently offline  git.user
Messages: 7
Registered: April 2007
Location: Moscow
Junior Member
kir wrote on Wed, 20 June 2007 11:35


We want things to "just work", and inside configuration to be in sync with the configuration we have on the node.



Tnx for your reply, Kir.
I'm sorry but seems like i've not understood somthing...
Can you explain, how a things will 'just work' if a guest root blocks incoming traffic by iptables inside the vps on per-IP basis? According to 'just work' logic you should patch an iptables config and restart iptables instead of root, nop? how it will works when sombody for god known reasons bind() his service to IP provided at vps startup while root of the nod change vps ip on the fly? i'm sorry but i think u just can't keep guest configuration in sync with the node. pls, pls don't protect me from my stupidity, don't protect anybody, it's not a right way...
Re: gentoo-add_ip.sh breaks gentoo net startup [message #14263 is a reply to message #14262] Wed, 20 June 2007 19:49 Go to previous messageGo to next message
kir is currently offline  kir
Messages: 1645
Registered: August 2005
Location: Moscow, Russia
Senior Member

Patches are always welcome Smile

Kir Kolyshkin
http://static.openvz.org/userbars/openvz-developer.png
Re: gentoo-add_ip.sh breaks gentoo net startup [message #14264 is a reply to message #14223] Wed, 20 June 2007 20:10 Go to previous messageGo to next message
git.user is currently offline  git.user
Messages: 7
Registered: April 2007
Location: Moscow
Junior Member
Argh... just forget it, it's of cours only up to openvz team how they see openvz should works.
Re: gentoo-add_ip.sh breaks gentoo net startup [message #14265 is a reply to message #14263] Wed, 20 June 2007 20:11 Go to previous messageGo to next message
git.user is currently offline  git.user
Messages: 7
Registered: April 2007
Location: Moscow
Junior Member
&& ok, i gothcha
Re: gentoo-add_ip.sh breaks gentoo net startup [message #14269 is a reply to message #14259] Thu, 21 June 2007 05:37 Go to previous messageGo to next message
seyko2 is currently offline  seyko2
Messages: 188
Registered: February 2007
Location: Moscow
Senior Member

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 Go to previous message
git.user is currently offline  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

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


Current Time: Sun Nov 17 21:01:16 GMT 2024

Total time taken to generate the page: 0.04063 seconds