#!/bin/sh
#
+# Copyright (c) 2011 Nicira Networks Inc.
# Copyright (c) 2007, 2009 Javier Fernandez-Sanguino <jfs@debian.org>
#
# This is free software; you may redistribute it and/or modify
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
-DAEMON=/usr/sbin/ovs-controller # Introduce the server's location here
+DAEMON=/usr/bin/ovs-controller # Introduce the server's location here
NAME=ovs-controller # Introduce the short server's name here
DESC=ovs-controller # Introduce a short description here
LOGDIR=/var/log/openvswitch # Log directory to use
. /lib/lsb/init-functions
# Default options, these can be overriden by the information
-# at /etc/default/$NAME
+# at /etc/default/openvswitch-controller
DAEMON_OPTS="" # Additional options given to the server
DODTIME=10 # Time to wait for the server to die, in seconds
exit 0
fi
+ if [ ! -d /var/run/openvswitch ]; then
+ install -d -m 755 -o root -g root /var/run/openvswitch
+ fi
+
SSL_OPTS=
case $LISTEN in
*ssl*)
if running ; then
kill -15 $pid
# Is it really dead?
- sleep "$DIETIME"s
+ sleep "$DODTIME"
if running ; then
kill -9 $pid
- sleep "$DIETIME"s
+ sleep "$DODTIME"
if running ; then
echo "Cannot kill $NAME (pid=$pid)!"
exit 1
log_daemon_msg "Restarting $DESC" "$NAME"
stop_server
# Wait some sensible amount, some server need this
- [ -n "$DIETIME" ] && sleep $DIETIME
+ [ -n "$DODTIME" ] && sleep $DODTIME
start_server
running
log_end_msg $?
log_warning_msg "cannot re-read the config file (use restart)."
;;
*)
- N=/etc/init.d/$NAME
+ N=/etc/init.d/openvswitch-controller
echo "Usage: $N {start|stop|force-stop|restart|force-reload|status}" >&2
exit 1
;;