]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
initscript: run valgrind with specified options
authorSage Weil <sage@newdream.net>
Thu, 23 Apr 2009 22:55:03 +0000 (15:55 -0700)
committerSage Weil <sage@newdream.net>
Thu, 23 Apr 2009 23:43:44 +0000 (16:43 -0700)
src/ceph_common.sh
src/init-ceph

index c8856e55af8aa361dd98cdd5b0bc0f9239a3f9b7..7350ff12f3529a0a649b17ca6c1297f09a99a1cf 100644 (file)
@@ -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
 }
 
index ef22638686d13f1598a20b2096cc0ca0efcb78cb..edf65ce179d360cc4a88eebd3dc80c3c81496f12 100755 (executable)
@@ -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
            ;;