Various fixes for vswitch-brcompatd init script.
authorJustin Pettit <jpettit@nicira.com>
Mon, 30 Mar 2009 20:31:46 +0000 (13:31 -0700)
committerJustin Pettit <jpettit@nicira.com>
Mon, 30 Mar 2009 20:31:46 +0000 (13:31 -0700)
vswitchd/etc/init.d/vswitch-brcompatd

index fa17cf821f93e33596f74ee1631c0876cbbcaa38..2cb017bde27e2697608d6945efe02f112c2be9b5 100755 (executable)
@@ -3,7 +3,7 @@
 # vswitch-brcompatd
 #
 # chkconfig: 2345 09 91
-# description: Manage vswitch kernel modules and user-space daemon
+# description: Manage bridge compatibility daemon for vswitchd
 #
 
 . /etc/init.d/functions
@@ -17,15 +17,15 @@ VSWITCHD_LOGFILE="${VSWITCHD_LOGFILE:-/var/log/vswitchd.log}"
 VSWITCHD_FILE_LOGLEVEL="${VSWITCHD_FILE_LOGLEVEL:-}"
 VSWITCHD_SYSLOG_LOGLEVEL="${VSWITCHD_SYSLOG_LOGLEVEL:-WARN}"
 VSWITCHD_MEMLEAK_LOGFILE="${VSWITCHD_MEMLEAK_LOGFILE:-}"
-BRCOMPATD_PIDFILE="${BRCOMPATD_PIDFILE:-/var/run/vswitchd.pid}"
+BRCOMPATD_PIDFILE="${BRCOMPATD_PIDFILE:-/var/run/brcompatd.pid}"
 BRCOMPATD_PRIORITY="${BRCOMPATD_PRIORITY:--5}"
-BRCOMPATD_LOGFILE="${BRCOMPATD_LOGFILE:-/var/log/vswitchd.log}"
+BRCOMPATD_LOGFILE="${BRCOMPATD_LOGFILE:-/var/log/brcompatd.log}"
 BRCOMPATD_FILE_LOGLEVEL="${BRCOMPATD_FILE_LOGLEVEL:-}"
 BRCOMPATD_SYSLOG_LOGLEVEL="${BRCOMPATD_SYSLOG_LOGLEVEL:-WARN}"
 BRCOMPATD_MEMLEAK_LOGFILE="${BRCOMPATD_MEMLEAK_LOGFILE:-}"
 
 function start {
-    if [ -n "$BRCOMPATD_PIDFILE" ]; then
+    if [ -z "$BRCOMPATD_PIDFILE" ]; then
         printf "No BRCOMPATD_PIDFILE specified.  Check /etc/sysconfig/vswitch\n"
         exit 1
     fi
@@ -59,7 +59,8 @@ function start {
         valgrind_opt="valgrind --log-file=$VALGRIND_LOG $VALGRIND_OPT"
         daemonize_opt=""
     fi
-    action "Starting brcompatd" nice -n "$BRCOMPATD_PRIORITY" $strace_opt $valgrind_opt $VSWITCH_BASE/vswitchd/brcompatd -P$BRCOMPATD_PIDFILE --vswitch-pidfile=$VSWITCHD_PIDFILE $daemonize_opt -vANY:CONSOLE:EMER $syslog_opt $logfile_level_opt $logfile_file_opt $leak_opt "$VSWITCHD_CONF"
+    action "Starting brcompatd" nice -n "$BRCOMPATD_PRIORITY"
+    $strace_opt $valgrind_opt $VSWITCH_BASE/vswitchd/brcompatd -P$BRCOMPATD_PIDFILE --vswitchd-pidfile=$VSWITCHD_PIDFILE $daemonize_opt -vANY:CONSOLE:EMER $syslog_opt $logfile_level_opt $logfile_file_opt $leak_opt "$VSWITCHD_CONF"
 }
 
 function stop {
@@ -86,12 +87,12 @@ case "$1" in
     restart-strace)
         shift
         stop
-        STRACE_LOG="/var/log/vswitchd.strace" STRACE_OPT="$*" start restart
+        STRACE_LOG="/var/log/brcompatd.strace" STRACE_OPT="$*" start restart
         ;;
     restart-valgrind)
         shift
         stop
-        VALGRIND_LOG="/var/log/vswitchd.valgrind" VALGRIND_OPT="$*" start restart
+        VALGRIND_LOG="/var/log/brcompatd.valgrind" VALGRIND_OPT="$*" start restart
         ;;
     strace)
         shift
@@ -104,7 +105,7 @@ case "$1" in
         "$VSWITCH_BASE"/vswitchd/brcompatd -V
         ;;
     help)
-        printf "vswitch [start|stop|restart|status|version]\n"
+        printf "vswitch-brcompatd [start|stop|restart|status|version]\n"
         ;;
     *)
         printf "Unknown command: $1\n"