]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
initscripts: fix do_root_cmd
authorSage Weil <sage@newdream.net>
Tue, 30 Jun 2009 19:16:54 +0000 (12:16 -0700)
committerSage Weil <sage@newdream.net>
Tue, 30 Jun 2009 19:16:54 +0000 (12:16 -0700)
sudo bash -c "echo foo" works, sudo "echo foo" does not.

src/ceph_common.sh

index b5cd1107b1a7f48505e74d4ed87b081f00740940..c6ebaf4075b27c96970c856eab4898d2fe247493 100644 (file)
@@ -63,7 +63,7 @@ do_root_cmd() {
     if [ -z "$ssh" ]; then
        [ $verbose -eq 1 ] && echo "--- $host# $1"
        ulimit -c unlimited
-       sudo "$1" || { echo "failed: '$1'" ; exit 1; }
+       sudo bash -c "$1" || { echo "failed: '$1'" ; exit 1; }
     else
        [ $verbose -eq 1 ] && echo "--- $ssh $2 \"cd $dir ; ulimit -c unlimited ; $1\""
        $rootssh $2 "cd $dir ; ulimit -c unlimited ; $1" || { echo "failed: '$ssh $1'" ; exit 1; }