sliver-ovs: ignore pid files when starting servers
authorGiuseppe Lettieri <g.lettieri@iet.unipi.it>
Tue, 25 Feb 2014 12:48:55 +0000 (13:48 +0100)
committerGiuseppe Lettieri <g.lettieri@iet.unipi.it>
Tue, 25 Feb 2014 12:48:55 +0000 (13:48 +0100)
ovs-vswitchd and ovs-dbserver already implement their
own logic to make sure that they have only one instance
running. Our solution was inferior, since it was easily
confused by stale pid files.

planetlab/scripts/sliver-ovs.in

index edda196..f7a7778 100755 (executable)
@@ -97,7 +97,6 @@ function start_db () {
     [ -d $RUN_DIR ] || { echo "Could not initialize $RUN_DIR - exiting" ; exit 1 ; }
 
     ## run the stuff
-    if [ ! -f "$RUN_DIR/ovsdb-server.pid" ]; then
        ovsdb-server $DB_CONF_FILE \
            --remote=punix:$DB_SOCKET \
            --remote=db:Open_vSwitch,Open_vSwitch,manager_options \
@@ -107,9 +106,6 @@ function start_db () {
            --pidfile \
            --log-file=$DB_LOG \
            --detach >& /dev/null
-    else
-       echo 'ovsdb-server appears to be running already, *not* starting'
-    fi
     wait_server $RUN_DIR/ovsdb-server.pid ovsdb-server 30
 }
 
@@ -119,15 +115,11 @@ function start_switch () {
     # ensure ovsdb-server is running
     is_db_running || { echo "ovsdb-server not running" >&2 ; exit 1 ; }
 
-    if [ ! -f "$RUN_DIR/ovs-vswitchd.pid" ] ; then
        ovs-vswitchd \
            --pidfile \
            --log-file=$SWITCH_LOG \
            --detach \
            unix:$DB_SOCKET >& /dev/null
-    else
-       echo 'ovs-vswitchd appears to be running already, *not* starting'
-    fi
     wait_server $RUN_DIR/ovs-vswitchd.pid ovs-vswitchd 30
 }