vswitch: Remove unnecessary iface_get_options function
[sliver-openvswitch.git] / debian / openvswitch-switch.init
index d860630..935ea48 100755 (executable)
@@ -93,10 +93,10 @@ force_stop() {
     [ ! -f "$pidfile" ] && return
     if running $name; then
         kill $pid
-        [ -n "$DODTIME" ] && sleep "$DODTIME"s
+        [ -n "$DODTIME" ] && sleep "$DODTIME"
         if running $name; then
             kill -KILL $pid
-            [ -n "$DODTIME" ] && sleep "$DODTIME"s
+            [ -n "$DODTIME" ] && sleep "$DODTIME"
             if running $name; then
                 echo "Cannot kill $name (pid=$pid)!"
                 exit 1
@@ -157,7 +157,7 @@ load_module() {
             echo "For instructions, read"
             echo "/usr/share/doc/openvswitch-datapath-source/README.Debian"
         fi
-        exit 1
+        exit 0
     fi
 }
 
@@ -203,13 +203,11 @@ case "$1" in
 
         # 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
+        elif ! running ovsdb-server; then
             # Upgrade or downgrade schema and compact database.
             ovsdb-tool -vANY:console:emer \
                 convert /etc/openvswitch/conf.db \
@@ -247,7 +245,7 @@ case "$1" in
         set -- "$@" --bootstrap-ca-cert=db:SSL,ca_cert
         set -- "$@" $OVSDB_SERVER_OPTS
         echo -n "Starting ovsdb-server: "
-        start-stop-daemon --start --quiet \
+        start-stop-daemon --start --quiet --oknodo \
             --pidfile /var/run/openvswitch/ovsdb-server.pid \
             --chdir /var/log/openvswitch/cores              \
             --exec $ovsdb_server -- "$@"
@@ -257,7 +255,7 @@ case "$1" in
             echo " ERROR."
         fi
 
-        ovs-vsctl --no-wait init
+        ovs-vsctl --no-wait --timeout=5 init
 
         # Start ovs-vswitchd.
         set --
@@ -267,7 +265,7 @@ case "$1" in
         set -- "$@" unix:/var/run/openvswitch/db.sock
         set -- "$@" $OVS_VSWITCHD_OPTS
         echo -n "Starting ovs-vswitchd: "
-        start-stop-daemon --start --quiet \
+        start-stop-daemon --start --quiet --oknodo \
             --pidfile /var/run/openvswitch/ovs-vswitchd.pid \
             --chdir /var/log/openvswitch/cores              \
             --exec $ovs_vswitchd -- "$@"