# 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
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
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 {
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
"$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"