X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=utilities%2Fovs-lib.in;h=50a59509419846a2b17a2f2808b625128b87e9d4;hb=d0c060994ae6c03ce18ee4f7be32795e85e892c2;hp=b8dc060a3c659f561416a7b6d15453bab4827723;hpb=7bb8f953527f8150dd5c2e50353a50ecd15e4427;p=sliver-openvswitch.git diff --git a/utilities/ovs-lib.in b/utilities/ovs-lib.in index b8dc060a3..50a595094 100644 --- a/utilities/ovs-lib.in +++ b/utilities/ovs-lib.in @@ -88,7 +88,8 @@ pid_exists () { start_daemon () { priority=$1 - shift + wrapper=$2 + shift; shift daemon=$1 # drop core files in a sensible place @@ -105,6 +106,30 @@ start_daemon () { 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" "$@"