5 # chkconfig: 2345 95 01
6 # description: Update vswitch configuration from XAPI database at boot
8 # Copyright (C) 2009 Nicira Networks, Inc.
10 # Licensed under the Apache License, Version 2.0 (the "License");
11 # you may not use this file except in compliance with the License.
12 # You may obtain a copy of the License at:
14 # http://www.apache.org/licenses/LICENSE-2.0
16 # Unless required by applicable law or agreed to in writing, software
17 # distributed under the License is distributed on an "AS IS" BASIS,
18 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 # See the License for the specific language governing permissions and
20 # limitations under the License.
22 . /etc/init.d/functions
24 test -e /etc/sysconfig/vswitch && . /etc/sysconfig/vswitch
25 : ${VSWITCHD_CONF:=/etc/ovs-vswitchd.conf}
26 : ${VSWITCHD_PIDFILE:=/var/run/ovs-vswitchd.pid}
27 : ${VSWITCHD_PRIORITY:=-5}
28 : ${VSWITCHD_LOGFILE:=/var/log/ovs-vswitchd.log}
29 : ${VSWITCHD_FILE_LOGLEVEL:=}
30 : ${VSWITCHD_SYSLOG_LOGLEVEL:=WARN}
31 : ${VSWITCHD_MEMLEAK_LOGFILE:=}
32 : ${BRCOMPATD_PIDFILE:=/var/run/ovs-brcompatd.pid}
33 : ${BRCOMPATD_PRIORITY:=-5}
34 : ${BRCOMPATD_LOGFILE:=/var/log/ovs-brcompatd.log}
35 : ${BRCOMPATD_FILE_LOGLEVEL:=}
36 : ${BRCOMPATD_SYSLOG_LOGLEVEL:=WARN}
37 : ${BRCOMPATD_MEMLEAK_LOGFILE:=}
39 function do_host_call {
40 xe host-call-plugin host-uuid="$INSTALLATION_UUID" plugin="vswitch-cfg-update" fn="update" >/dev/null
44 if [ ! -f /etc/xensource-inventory ]; then
45 printf "vswitch-xapi-update ERROR: XenSource inventory not present in /etc/xensource-inventory\n"
48 source /etc/xensource-inventory
49 action "Updating configuration" do_host_call
63 printf "vswitch [start|stop|restart]\n"
66 printf "Unknown command: $1\n"