This is occasionally useful for debugging.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Sets the \fBnice\fR(1) level used for each daemon. All of them
default to \fB\-10\fR.
.
+.IP "\fB\-\-ovsdb\-server\-wrapper=\fIwrapper\fR"
+.IQ "\fB\-\-ovs\-vswitchd\-wrapper=\fIwrapper\fR"
+.IQ "\fB\-\-ovs\-brcompatd\-wrapper=\fIwrapper\fR"
+.
+Configures the specified daemon to run under \fIwrapper\fR, which is
+one of the following:
+.
+.RS
+.IP "\fBvalgrind\fR"
+Run the daemon under \fBvalgrind\fR(1), if it is installed, logging to
+\fIdaemon\fB.valgrind.log.\fIpid\fR in the log directory.
+.
+.IP "\fBstrace\fR"
+Run the daemon under \fBstrace\fR(1), if it is installed, logging to
+\fIdaemon\fB.strace.log.\fIpid\fR in the log directory.
+.RE
+.
+.IP
+By default, no wrapper is used.
+.
+.IP
+Wrappers greatly slow daemon operations so they should not be used in
+production. They also produce voluminous logs that can quickly fill
+small disk partitions.
+.
.PP
The following options control file locations. They should only be
used if the default locations cannot be used. See \fBFILES\fR, below,
set "$@" --private-key=db:SSL,private_key
set "$@" --certificate=db:SSL,certificate
set "$@" --bootstrap-ca-cert=db:SSL,ca_cert
- start_daemon "$OVSDB_SERVER_PRIORITY" "$@" || return 1
+ start_daemon "$OVSDB_SERVER_PRIORITY" "$OVSDB_SERVER_WRAPPER" "$@" \
+ || return 1
# Initialize database settings.
ovs_vsctl -- init -- set Open_vSwitch . db-version="$schemaver" \
if test X"$MLOCKALL" != Xno; then
set "$@" --mlockall
fi
- start_daemon "$OVS_VSWITCHD_PRIORITY" "$@"
+ start_daemon "$OVS_VSWITCHD_PRIORITY" "$OVS_VSWITCHD_WRAPPER" "$@"
fi
if daemon_is_running ovs-brcompatd; then
elif test X"$BRCOMPAT" = Xyes; then
set ovs-brcompatd
set "$@" -vconsole:emer -vsyslog:err -vfile:info
- start_daemon "$OVS_BRCOMPATD_PRIORITY" "$@"
+ start_daemon "$OVS_BRCOMPATD_PRIORITY" "$OVS_BRCOMPATD_WRAPPER" "$@"
fi
}
OVSDB_SERVER_PRIORITY=-10
OVS_VSWITCHD_PRIORITY=-10
OVS_BRCOMPATD_PRIORITY=-10
+ OVSDB_SERVER_WRAPPER=
+ OVS_VSWITCHD_WRAPPER=
+ OVS_BRCOMPATD_WRAPPER=
DB_FILE=$etcdir/conf.db
DB_SOCK=$rundir/db.sock
--ovs-vswitchd-priority=NICE set ovs-vswitchd's niceness (default: $OVS_VSWITCHD_PRIORITY)
--ovs-brcompatd-priority=NICE set ovs-brcompatd's niceness (default: $OVS_BRCOMPATD_PRIORITY)
+Debugging options for "start" and "force-reload-kmod":
+ --ovsdb-server-wrapper=WRAPPER
+ --ovs-vswitchd-wrapper=WRAPPER
+ --ovs-vswitchd-wrapper=WRAPPER
+ run specified daemon under WRAPPER (either 'valgrind' or 'strace')
+
Options for "start", "force-reload-kmod", "load-kmod", "status", and "version":
--brcompat enable Linux bridge compatibility module and daemon
start_daemon () {
priority=$1
- shift
+ wrapper=$2
+ shift; shift
daemon=$1
# drop core files in a sensible place
set "$@" --pidfile="$rundir/$daemon.pid"
set "$@" --detach --monitor
+ # wrapper
+ case $wrapper in
+ valgrind)
+ if (valgrind --version) > /dev/null 2>&1; then
+ set valgrind -q --leak-check=full \
+ --log-file="$logdir/$daemon.valgrind.log.%p" "$@"
+ else
+ log_failure_msg "valgrind not installed, running $daemon without it"
+ fi
+ ;;
+ strace)
+ if (strace -V) > /dev/null 2>&1; then
+ set strace -D -ff -o "$logdir/$daemon.strace.log" "$@"
+ else
+ log_failure_msg "strace not installed, running $daemon without it"
+ fi
+ ;;
+ '')
+ ;;
+ *)
+ log_failure_msg "unknown wrapper $wrapper, running $daemon without it"
+ ;;
+ esac
+
# priority
if test X"$priority" != X; then
set nice -n "$priority" "$@"