+ # Create an empty configuration database if it doesn't exist.
+ if test ! -e /etc/openvswitch/conf.db; then
+ install -d -m 755 -o root -g root /etc/openvswitch
+
+ # Create configuration database.
+ ovsdb-tool -vANY:console:emer \
+ create /etc/openvswitch/conf.db \
+ /usr/share/openvswitch/vswitch.ovsschema
+ else
+ # Upgrade or downgrade schema and compact database.
+ ovsdb-tool -vANY:console:emer \
+ convert /etc/openvswitch/conf.db \
+ /usr/share/openvswitch/vswitch.ovsschema
+ fi
+
+ if test "$ENABLE_MONITOR" = y; then
+ monitor_opt=--monitor
+ else
+ monitor_opt=
+ fi
+
+ if [ ! -d /var/run/openvswitch ]; then
+ install -d -m 755 -o root -g root /var/run/openvswitch
+ fi
+
+ if [ ! -d /var/log/openvswitch ]; then
+ install -d -m 755 -o root -g root /var/log/openvswitch
+ fi
+