[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] network-bridge script reworked



On Fri, Oct 21, 2005 at 02:48:09PM +0100, Ewan Mellor wrote:
> On Thu, Oct 20, 2005 at 08:22:20PM +0200, Kurt Garloff wrote:
> Is this a reasonable solution:
> 
> if [ -e /etc/SuSE-release ]
> then
>   ifup()
>   {
>     eval `/sbin/getcfg -d /etc/sysconfig/network/ -f ifcfg- -- $1`
>     /sbin/ifup ${HWD_CONFIG_0} $1
>   }
>   ifdown()
>   {
>     eval `/sbin/getcfg -d /etc/sysconfig/network/ -f ifcfg- -- $1`
>     /sbin/ifdown ${HWD_CONFIG_0} $1
>   }

I like the approachm but it won't work.
The reason is that we do the eval before the renaming of network
interfaces. 
So we get the config of the physical device in ${HWD_CONFIG_0}, then
do the renaming, reassignment of MAC addresses and then use the config
to ifup the virtual device.

> In other words, override ifup and ifdown to do the right thing on SuSE.  That
> way, in our scripts we can just write "ifup eth0".  We already are doing this
> for Gentoo, so this would be my preferred solution, as it keeps all the
> distro-specific stuff out of the script bodies.
> 
> My only doubt is that you use the eval before ifup and ifdown in op_start(),
> but not in op_stop(), and I wonder whether that is important.

It's cleaner and safer to do it at both places.
But it's hard to get it right due to the interface renaming for ifdown.
So I did not address this: ifdown does little more than ip link down and
kill dhcpcd ... so this is not an issue in real life.

Best,
-- 
Kurt Garloff, Director SUSE Labs, Novell Inc.

Attachment: pgpeWF7w5gVuZ.pgp
Description: PGP signature

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.