debian: Make the init script's start command idempotent
authorSimon Horman <horms@verge.net.au>
Wed, 13 Oct 2010 22:18:20 +0000 (07:18 +0900)
committerBen Pfaff <blp@nicira.com>
Wed, 13 Oct 2010 22:22:13 +0000 (15:22 -0700)
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
debian/openvswitch-switch.init

index 0907cdf7ca96120253b872f3a682a32f13537be9..871ac2d4fa9faa45f4307f75d04a3ea9c1b0bc25 100755 (executable)
@@ -209,7 +209,7 @@ case "$1" in
             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 +247,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 -- "$@"
@@ -267,7 +267,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 -- "$@"