ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dbhowm...@apache.org
Subject ambari git commit: AMBARI-17197 Zeppelin: Remove permission updates and user creation from service definition. (Renjith Kamath via dipayanb)
Date Mon, 20 Jun 2016 11:36:36 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 8a4d95940 -> ac8adabb3


AMBARI-17197 Zeppelin: Remove permission updates and user creation from service definition.
(Renjith Kamath via dipayanb)


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

Branch: refs/heads/trunk
Commit: ac8adabb3d0f3b1663fd1d1491d609172f41549a
Parents: 8a4d959
Author: Dipayan Bhowmick <dipayan.bhowmick@gmail.com>
Authored: Mon Jun 20 17:05:24 2016 +0530
Committer: Dipayan Bhowmick <dipayan.bhowmick@gmail.com>
Committed: Mon Jun 20 17:06:08 2016 +0530

----------------------------------------------------------------------
 .../0.6.0.2.5/configuration/zeppelin-env.xml     |  8 ++++++++
 .../package/scripts/alert_check_zeppelin.py      |  2 ++
 .../ZEPPELIN/0.6.0.2.5/package/scripts/master.py | 19 -------------------
 .../ZEPPELIN/0.6.0.2.5/package/scripts/params.py |  2 +-
 4 files changed, 11 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/ac8adabb/ambari-server/src/main/resources/common-services/ZEPPELIN/0.6.0.2.5/configuration/zeppelin-env.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/ZEPPELIN/0.6.0.2.5/configuration/zeppelin-env.xml
b/ambari-server/src/main/resources/common-services/ZEPPELIN/0.6.0.2.5/configuration/zeppelin-env.xml
index f77d817..2f5ac59 100644
--- a/ambari-server/src/main/resources/common-services/ZEPPELIN/0.6.0.2.5/configuration/zeppelin-env.xml
+++ b/ambari-server/src/main/resources/common-services/ZEPPELIN/0.6.0.2.5/configuration/zeppelin-env.xml
@@ -28,6 +28,10 @@
     <value>zeppelin</value>
     <property-type>USER</property-type>
     <description>User zeppelin daemon runs as</description>
+    <value-attributes>
+      <type>user</type>
+      <overridable>false</overridable>
+    </value-attributes>
     <on-ambari-upgrade add="true"/>
   </property>
   <property>
@@ -35,6 +39,10 @@
     <value>zeppelin</value>
     <property-type>GROUP</property-type>
     <description>zeppelin group</description>
+    <value-attributes>
+      <type>user</type>
+      <overridable>false</overridable>
+    </value-attributes>
     <on-ambari-upgrade add="true"/>
   </property>
   <property>

http://git-wip-us.apache.org/repos/asf/ambari/blob/ac8adabb/ambari-server/src/main/resources/common-services/ZEPPELIN/0.6.0.2.5/package/scripts/alert_check_zeppelin.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/ZEPPELIN/0.6.0.2.5/package/scripts/alert_check_zeppelin.py
b/ambari-server/src/main/resources/common-services/ZEPPELIN/0.6.0.2.5/package/scripts/alert_check_zeppelin.py
index 3680222..e6d7a91 100644
--- a/ambari-server/src/main/resources/common-services/ZEPPELIN/0.6.0.2.5/package/scripts/alert_check_zeppelin.py
+++ b/ambari-server/src/main/resources/common-services/ZEPPELIN/0.6.0.2.5/package/scripts/alert_check_zeppelin.py
@@ -21,6 +21,8 @@ import glob
 import sys
 
 from resource_management.core.exceptions import ComponentIsNotRunning
+from resource_management.libraries.functions.check_process_status import check_process_status
+from resource_management.libraries.script import Script
 
 reload(sys)
 sys.setdefaultencoding('utf8')

http://git-wip-us.apache.org/repos/asf/ambari/blob/ac8adabb/ambari-server/src/main/resources/common-services/ZEPPELIN/0.6.0.2.5/package/scripts/master.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/ZEPPELIN/0.6.0.2.5/package/scripts/master.py
b/ambari-server/src/main/resources/common-services/ZEPPELIN/0.6.0.2.5/package/scripts/master.py
index d4f1e83..fd73464 100644
--- a/ambari-server/src/main/resources/common-services/ZEPPELIN/0.6.0.2.5/package/scripts/master.py
+++ b/ambari-server/src/main/resources/common-services/ZEPPELIN/0.6.0.2.5/package/scripts/master.py
@@ -19,10 +19,7 @@ limitations under the License.
 """
 
 import glob
-import grp
 import os
-import pwd
-import sys
 from resource_management.core.resources import Directory
 from resource_management.core.resources.system import Execute, File
 from resource_management.core.source import InlineTemplate
@@ -36,15 +33,9 @@ class Master(Script):
     import params
     env.set_params(params)
 
-    Execute('chmod -R 755 ' + params.service_packagedir)
     Execute('chmod a+x ' + os.path.join(params.service_packagedir, "scripts/setup_snapshot.sh"))
-
-    # Create user and group if they don't exist
-    self.create_linux_user(params.zeppelin_user, params.zeppelin_group)
     self.install_packages(env)
 
-    Execute('chown -R ' + params.zeppelin_user + ':' + params.zeppelin_group + ' ' + params.zeppelin_dir)
-
     # create the pid and zeppelin dirs
     Directory([params.zeppelin_pid_dir, params.zeppelin_dir],
               owner=params.zeppelin_user,
@@ -66,16 +57,6 @@ class Master(Script):
                    "{java64_home} >> {zeppelin_log_file}"),
             user=params.zeppelin_user)
 
-  def create_linux_user(self, user, group):
-    try:
-      pwd.getpwnam(user)
-    except KeyError:
-      Execute('adduser ' + user)
-    try:
-      grp.getgrnam(group)
-    except KeyError:
-      Execute('groupadd ' + group)
-
   def create_zeppelin_dir(self, params):
     params.HdfsResource(format("/user/{zeppelin_user}"),
                         type="directory",

http://git-wip-us.apache.org/repos/asf/ambari/blob/ac8adabb/ambari-server/src/main/resources/common-services/ZEPPELIN/0.6.0.2.5/package/scripts/params.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/ZEPPELIN/0.6.0.2.5/package/scripts/params.py
b/ambari-server/src/main/resources/common-services/ZEPPELIN/0.6.0.2.5/package/scripts/params.py
index 04926b7..7cede1e 100644
--- a/ambari-server/src/main/resources/common-services/ZEPPELIN/0.6.0.2.5/package/scripts/params.py
+++ b/ambari-server/src/main/resources/common-services/ZEPPELIN/0.6.0.2.5/package/scripts/params.py
@@ -46,7 +46,7 @@ stack_root = Script.get_stack_root()
 # e.g. /var/lib/ambari-agent/cache/stacks/HDP/2.2/services/zeppelin-stack/package
 service_packagedir = os.path.realpath(__file__).split('/scripts')[0]
 
-zeppelin_dirname = 'zeppelin-server/lib'
+zeppelin_dirname = 'zeppelin-server'
 
 install_dir = os.path.join(stack_root, "current")
 executor_mem = config['configurations']['zeppelin-env']['zeppelin.executor.mem']


Mime
View raw message