diff options
author | Justin Pettit <jpettit@nicira.com> | 2011-05-09 23:30:07 -0700 |
---|---|---|
committer | Justin Pettit <jpettit@nicira.com> | 2011-05-11 09:40:39 -0700 |
commit | f8d17df2b2600d00267d7fcea1f34615c3f3ef50 (patch) | |
tree | eb1b7932268023106e8a604bf4f329b02f45f8b4 /xenserver | |
parent | bf8f2167fd3107f5513d487a69a6568cf51afd68 (diff) |
xenserver: Fix bugs related to using xe-switch-network-backend in spec file.
Commit daf2ebb (xenserver: Use xe-switch-network-stack in RPM spec
file.) changed the spec file to use xe-switch-network-backend instead of
directly modifying "/etc/xensource/network.conf". It incorrectly
assumed that the command was in the search path. It also didn't take
into account that the command will remove the "openvswitch" service with
chkconfig. This commit fixes those errors.
Signed-off-by: Justin Pettit <jpettit@nicira.com>
Diffstat (limited to 'xenserver')
-rw-r--r-- | xenserver/openvswitch-xen.spec | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/xenserver/openvswitch-xen.spec b/xenserver/openvswitch-xen.spec index 7409fdfc..9d686ce4 100644 --- a/xenserver/openvswitch-xen.spec +++ b/xenserver/openvswitch-xen.spec @@ -226,7 +226,7 @@ done if [ "$1" = "1" ]; then # $1 = 1 for install # Configure system to use Open vSwitch - xe-switch-network-backend vswitch + /opt/xensource/bin/xe-switch-network-backend vswitch else # $1 = 2 for upgrade mode=$(cat /etc/xensource/network.conf) @@ -248,8 +248,15 @@ depmod %{xen_version} %preun 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 @@ -303,11 +310,10 @@ if [ "$1" = "0" ]; then # $1 = 0 for uninstall # 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 |