bigtop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From m...@apache.org
Subject git commit: BIGTOP-1034: Custom user's home directory's creation fails in init-hdfs.sh
Date Sat, 27 Jul 2013 23:25:23 GMT
Updated Branches:
  refs/heads/master e498ac4ee -> de6703ca5


BIGTOP-1034: Custom user's home directory's creation fails in init-hdfs.sh

Signed-off-by: Mark Grover <mark@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/bigtop/repo
Commit: http://git-wip-us.apache.org/repos/asf/bigtop/commit/de6703ca
Tree: http://git-wip-us.apache.org/repos/asf/bigtop/tree/de6703ca
Diff: http://git-wip-us.apache.org/repos/asf/bigtop/diff/de6703ca

Branch: refs/heads/master
Commit: de6703ca549212c990dcc2b996dd0175b0e87d36
Parents: e498ac4
Author: Henry Wang <henry.wang@wandisco.com>
Authored: Sat Jul 27 16:16:10 2013 -0700
Committer: Mark Grover <mark@apache.org>
Committed: Sat Jul 27 16:23:21 2013 -0700

----------------------------------------------------------------------
 bigtop-packages/src/common/hadoop/init-hdfs.sh | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/bigtop/blob/de6703ca/bigtop-packages/src/common/hadoop/init-hdfs.sh
----------------------------------------------------------------------
diff --git a/bigtop-packages/src/common/hadoop/init-hdfs.sh b/bigtop-packages/src/common/hadoop/init-hdfs.sh
index 4e12bf1..bc96761 100755
--- a/bigtop-packages/src/common/hadoop/init-hdfs.sh
+++ b/bigtop-packages/src/common/hadoop/init-hdfs.sh
@@ -88,10 +88,10 @@ fi
 if [ "$1" = "-u" ] ; then
   USER="$2"
   USER=${USER:-$(id -un)}
-  su -s /bin/bash hdfs -c "/usr/bin/hadoop fs -ls /user/${USER}"
-  if [ ! $? -eq 0 ]; then
+  EXIST=$(su -s /bin/bash hdfs -c "/usr/bin/hadoop fs -ls /user/${USER}" &> /dev/null;
echo $?)
+  if [ ! $EXIST -eq 0 ]; then
     su -s /bin/bash hdfs -c "/usr/bin/hadoop fs -mkdir /user/${USER}"
     su -s /bin/bash hdfs -c "/usr/bin/hadoop fs -chmod -R 755 /user/${USER}"
     su -s /bin/bash hdfs -c "/usr/bin/hadoop fs -chown ${USER} /user/${USER}"
   fi
-fi
+fi
\ No newline at end of file


Mime
View raw message