[ovs-dev] [PATCH 4 of 5] Clear stale configuration keys on boot

Ben Pfaff blp at nicira.com
Wed Sep 30 20:20:16 UTC 2009

Ian Campbell <ian.campbell at citrix.com> writes:

> diff -r 655d69fcd68a -r aa941ec68c03 xenserver/etc_init.d_vswitch
> --- a/xenserver/etc_init.d_vswitch	Wed Sep 30 11:17:45 2009 +0100
> +++ b/xenserver/etc_init.d_vswitch	Wed Sep 30 11:38:22 2009 +0100
> @@ -264,6 +264,12 @@
>      if [ ! -e "$VSWITCHD_CONF" ]; then
>          warning "$VSWITCHD_CONF does not exist"
>          action "Creating empty $VSWITCHD_CONF" touch "$VSWITCHD_CONF"
> +    else
> +	/usr/bin/ovs-cfg-mod '-vANY:console:emer' -F "$VSWITCHD_CONF" \
> +	    '--del-match=bridge.*' \
> +	    '--del-match=port.*' \
> +	    '--del-match=bonding.*' \
> +	    '--del-match=iface.*'
>      fi

It makes a lot of sense to do this (frankly we ought to have been
doing this all along) but doing it here will break "service
vswitch restart", which normally works OK, at least for me.  We
need some way to only delete all that on first boot, but not
later.  I wonder if there's a good way to tell.  We could just
avoid it when "restart" is used, but then anyone who does
"service vswitch stop; service vswitch stop" gets screwed, which
is not good either.

Is there a good way to tell that this is the first time we're
being run?  Maybe we can create a file in /var/run, since that
gets cleaned at boot time.

More information about the dev mailing list