You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@zeppelin.apache.org by "heyang wang (JIRA)" <ji...@apache.org> on 2017/04/21 03:49:04 UTC

[jira] [Created] (ZEPPELIN-2436) ZEPPELIN_IMPERSONATE_CMD doesn't support echo command

heyang wang created ZEPPELIN-2436:
-------------------------------------

             Summary: ZEPPELIN_IMPERSONATE_CMD doesn't support echo command
                 Key: ZEPPELIN-2436
                 URL: https://issues.apache.org/jira/browse/ZEPPELIN-2436
             Project: Zeppelin
          Issue Type: Bug
          Components: Interpreters
    Affects Versions: 0.7.1
         Environment: Spark 2.0,livy 3.0,hadoop 2.7.2,centos 6,ldap
            Reporter: heyang wang


I followed the doc on https://zeppelin.apache.org/docs/0.7.0/manual/userimpersonation.html to enable user impersontaion. 
I did export ZEPPELIN_IMPERSONATE_CMD='sudo -H -u ${ZEPPELIN_IMPERSONATE_USER} bash -c '  in zeppelin-env.sh.
However, since I am also using ldap, the user is of form name@company.com and useradd can't add such user with the @ mark.
So I thought I could get only the username without the @ subfix using the following command:
export ZEPPELIN_IMPERSONATE_CMD='echo ${ZEPPELIN_IMPERSONATE_USER} | cut -d \@ -f 1 |xargs -I {} sudo -H -u {} bash -c '
However this setting bring error like "sudo no such user {}".
The reason is because the following line of code in bin/interpreter.sh:
ZEPPELIN_IMPERSONATE_RUN_CMD=$(eval "echo ${ZEPPELIN_IMPERSONATE_CMD} ")
The eval echo before ZEPPELIN_IMPERSONATE_CMD actually execute the ZEPPELIN_IMPERSONATE_CMD which cause the error.
My temporary workaround is change the above code to:
ZEPPELIN_IMPERSONATE_RUN_CMD=$ZEPPELIN_IMPERSONATE_CMD
It seems the "eval echo " is placed there for some checking. Is there a better  solution to support costume ZEPPELIN_IMPERSONATE_CMD?



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)