X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=xenserver%2Fopenvswitch-xen.spec;h=492e0dc3a01ca1507c27fbda58fdc5e00ba7dd1c;hb=f9b1f3983adfe00b953c7a6042d6f90df150e758;hp=6c030a45b3757870ccee0942b76ec2de4a3e3dbc;hpb=0f50458b0a3054566c4f5cd70e0bc92ca7dafe49;p=sliver-openvswitch.git diff --git a/xenserver/openvswitch-xen.spec b/xenserver/openvswitch-xen.spec index 6c030a45b..492e0dc3a 100644 --- a/xenserver/openvswitch-xen.spec +++ b/xenserver/openvswitch-xen.spec @@ -228,8 +228,8 @@ done if [ "$1" = "1" ]; then # $1 = 2 for upgrade # Configure system to use Open vSwitch - xe-switch-network-backend vswitch -else + /opt/xensource/bin/xe-switch-network-backend vswitch +else # $1 = 2 for upgrade mode=$(cat /etc/xensource/network.conf) if [ "$mode" != "vswitch" ] && [ "$mode" != "openvswitch" ]; then @@ -249,9 +249,16 @@ fi depmod %{xen_version} %preun -if [ "$1" = "0" ]; then # $1 = 1 for upgrade +if [ "$1" = "0" ]; then # $1 = 0 for uninstall + # Configure system to use bridge + /opt/xensource/bin/xe-switch-network-backend bridge + + # The "openvswitch" service should have been removed from + # "xe-switch-network-backend bridge". for s in openvswitch openvswitch-xapi-update; do - chkconfig --del $s || printf "Could not remove $s init script." + if chkconfig --list $s >/dev/null 2>&1; then + chkconfig --del $s || printf "Could not remove $s init script." + fi done fi @@ -305,11 +312,10 @@ if [ "$1" = "0" ]; then # $1 = 1 for upgrade # Remove saved XenServer scripts directory, but only if it's empty rmdir -p /usr/lib/openvswitch/xs-saved 2>/dev/null - - # Configure system to use bridge - xe-switch-network-backend bridge fi +exit 0 + %files %defattr(-,root,root) /etc/init.d/openvswitch