From: Sage Weil Date: Thu, 23 Apr 2009 22:55:03 +0000 (-0700) Subject: initscript: run valgrind with specified options X-Git-Tag: v0.7.3~59 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=24b4d79059d3097d1610dea44516ed98c44c6d24;p=ceph.git initscript: run valgrind with specified options --- diff --git a/src/ceph_common.sh b/src/ceph_common.sh index c8856e55af8a..7350ff12f352 100644 --- a/src/ceph_common.sh +++ b/src/ceph_common.sh @@ -42,12 +42,14 @@ check_host() { } do_cmd() { - [ $verbose -eq 1 ] && echo "--- $host:$dir# $1" if [ -z "$ssh" ]; then + [ $verbose -eq 1 ] && echo "--- $host# $1" ulimit -c unlimited bash -c "$1" || { echo "failed: '$1'" ; exit 1; } else - $ssh "cd $dir ; ulimit -c unlimited ; $1" || { echo "failed: '$ssh $1'" ; exit 1; } + [ $verbose -eq 1 ] && echo "--- $host# cd $dir ; ulimit -c unlimited ; $1" + echo $ssh $2 "cd $dir ; ulimit -c unlimited ; $1" + $ssh $2 "cd $dir ; ulimit -c unlimited ; $1" || { echo "failed: '$ssh $1'" ; exit 1; } fi } diff --git a/src/init-ceph b/src/init-ceph index ef22638686d1..edf65ce179d3 100755 --- a/src/init-ceph +++ b/src/init-ceph @@ -156,15 +156,16 @@ for name in $what; do # build final command wrap="" runmode="" + runarg="" [ -z "$crun" ] && get_conf_bool crun "0" "restart on core dump" [ "$crun" -eq 1 ] && wrap="$BINDIR/crun" - [ -z "$dovalgrind" ] && get_conf_bool valgrind "0" "valgrind" - [ "$valgrind" -eq 1 ] && wrap="$wrap valgrind" - - [ -n "$wrap" ] && runmode="-f &" + [ -z "$dovalgrind" ] && get_conf_bool valgrind "" "valgrind" + [ -n "$valgrind" ] && wrap="$wrap valgrind $valgrind" + [ -n "$wrap" ] && runmode="-f &" && runarg="-f" + cmd="$wrap $cmd $runmode" echo Starting ceph $name on $host... @@ -178,7 +179,7 @@ for name in $what; do get_conf pre_start "" "pre start command" get_conf post_start "" "post start command" [ -n "$pre_start" ] && do_cmd $pre_start - do_cmd "$cmd" + do_cmd "$cmd" $runarg [ -n "$post_start" ] && do_cmd $post_start ;;