summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTommi Virtanen <tommi.virtanen@dreamhost.com>2011-09-06 14:55:28 -0700
committerTommi Virtanen <tommi.virtanen@dreamhost.com>2011-09-06 15:57:17 -0700
commit71dc75bdafe62a098c0493ad62f2d0d2a6ca7946 (patch)
tree637a6bac7494a4fc5d3ce363191972ac5521e0a6
parent693c4e50e574e51e21b9aec7d7400d6e1583603a (diff)
downloadceph-71dc75bdafe62a098c0493ad62f2d0d2a6ca7946.tar.gz
mkcephfs: Config $user is irrelevant when we want to run as root.
It used to just not sudo if $user was empty, on non-ssh do_root_cmd's. This bug was exposed by commit 47b09e2f0463f6a5ea8cc8e127b012a0cf1ec4af. Signed-off-by: Tommi Virtanen <tommi.virtanen@dreamhost.com>
-rw-r--r--src/ceph_common.sh7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/ceph_common.sh b/src/ceph_common.sh
index 0c5ea52d849..adb8783f4e9 100644
--- a/src/ceph_common.sh
+++ b/src/ceph_common.sh
@@ -97,12 +97,7 @@ do_root_cmd() {
if [ -z "$ssh" ]; then
[ $verbose -eq 1 ] && echo "--- $host# $1"
ulimit -c unlimited
- whoami=`whoami`
- if [ "$whoami" = "root" ] || [ -z "$user" ]; then
- bash -c "$1" || { echo "failed: '$1'" ; exit 1; }
- else
- sudo bash -c "$1" || { echo "failed: '$1'" ; exit 1; }
- fi
+ sudo bash -c "$1" || { echo "failed: '$1'" ; exit 1; }
else
[ $verbose -eq 1 ] && echo "--- $rootssh $2 \"cd $sshdir ; ulimit -c unlimited ; $1\""
$rootssh $2 "cd $sshdir ; ulimit -c unlimited ; $1" || { echo "failed: '$rootssh $1'" ; exit 1; }