diff options
author | Sage Weil <sage@newdream.net> | 2009-03-24 12:55:01 -0700 |
---|---|---|
committer | Sage Weil <sage@newdream.net> | 2009-03-24 12:55:01 -0700 |
commit | 4160adcbfaf7e6f5832cb035dbcfbcefd45ae70f (patch) | |
tree | e7e53f4d369ee940fd4706d89b1f524f2cf9835e /src/ceph_common.sh | |
parent | 565dae5e4d72a2a953967192a3f9afb437e5cafc (diff) | |
download | ceph-4160adcbfaf7e6f5832cb035dbcfbcefd45ae70f.tar.gz |
initscripts: make do_cmd properly bail when command fails
And print what command it was that failed.
Diffstat (limited to 'src/ceph_common.sh')
-rw-r--r-- | src/ceph_common.sh | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/ceph_common.sh b/src/ceph_common.sh index 11b6521f54a..c8856e55af8 100644 --- a/src/ceph_common.sh +++ b/src/ceph_common.sh @@ -45,9 +45,9 @@ do_cmd() { [ $verbose -eq 1 ] && echo "--- $host:$dir# $1" if [ -z "$ssh" ]; then ulimit -c unlimited - bash -c "$1" || (echo failed. ; exit 1) + bash -c "$1" || { echo "failed: '$1'" ; exit 1; } else - $ssh "cd $dir ; ulimit -c unlimited ; $1" || (echo failed. ; exit 1) + $ssh "cd $dir ; ulimit -c unlimited ; $1" || { echo "failed: '$ssh $1'" ; exit 1; } fi } |