ambari-commits mailing list archives

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


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

This reverts commit cd47a9697e170b8919bb36a0cca4401158b1b1c5.


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

Branch: refs/heads/trunk
Commit: 8a4d959409d235ce2280ca84b3136fd3680c1bfd
Parents: 5dc6f64
Author: Dipayan Bhowmick <dipayan.bhowmick@gmail.com>
Authored: Mon Jun 20 17:03:07 2016 +0530
Committer: Dipayan Bhowmick <dipayan.bhowmick@gmail.com>
Committed: Mon Jun 20 17:03:07 2016 +0530

----------------------------------------------------------------------
 .../0.6.0.2.5/configuration/zeppelin-env.xml     | 14 ++++++++++++++
 .../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 |  7 +++----
 .../0.6.0.2.5/package/scripts/status_params.py   |  3 ++-
 5 files changed, 38 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/8a4d9594/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 226bc17..f77d817 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
@@ -24,6 +24,20 @@
     <on-ambari-upgrade add="true"/>
   </property>
   <property>
+    <name>zeppelin_user</name>
+    <value>zeppelin</value>
+    <property-type>USER</property-type>
+    <description>User zeppelin daemon runs as</description>
+    <on-ambari-upgrade add="true"/>
+  </property>
+  <property>
+    <name>zeppelin_group</name>
+    <value>zeppelin</value>
+    <property-type>GROUP</property-type>
+    <description>zeppelin group</description>
+    <on-ambari-upgrade add="true"/>
+  </property>
+  <property>
     <name>zeppelin_log_dir</name>
     <value>/var/log/zeppelin</value>
     <description>Zeppelin Log dir</description>

http://git-wip-us.apache.org/repos/asf/ambari/blob/8a4d9594/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 e6d7a91..3680222 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,8 +21,6 @@ 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/8a4d9594/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 fd73464..d4f1e83 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,7 +19,10 @@ 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
@@ -33,9 +36,15 @@ 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,
@@ -57,6 +66,16 @@ 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/8a4d9594/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 3fc19d1..04926b7 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'
+zeppelin_dirname = 'zeppelin-server/lib'
 
 install_dir = os.path.join(stack_root, "current")
 executor_mem = config['configurations']['zeppelin-env']['zeppelin.executor.mem']
@@ -68,10 +68,9 @@ except:
 # params from zeppelin-config
 zeppelin_port = str(config['configurations']['zeppelin-config']['zeppelin.server.port'])
 
-zeppelin_user = "zeppelin"
-zeppelin_group = "zeppelin"
-
 # params from zeppelin-env
+zeppelin_user = config['configurations']['zeppelin-env']['zeppelin_user']
+zeppelin_group = config['configurations']['zeppelin-env']['zeppelin_group']
 zeppelin_log_dir = config['configurations']['zeppelin-env']['zeppelin_log_dir']
 zeppelin_pid_dir = config['configurations']['zeppelin-env']['zeppelin_pid_dir']
 zeppelin_log_file = os.path.join(zeppelin_log_dir, 'zeppelin-setup.log')

http://git-wip-us.apache.org/repos/asf/ambari/blob/8a4d9594/ambari-server/src/main/resources/common-services/ZEPPELIN/0.6.0.2.5/package/scripts/status_params.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/ZEPPELIN/0.6.0.2.5/package/scripts/status_params.py
b/ambari-server/src/main/resources/common-services/ZEPPELIN/0.6.0.2.5/package/scripts/status_params.py
index ed5512b..35360c6 100644
--- a/ambari-server/src/main/resources/common-services/ZEPPELIN/0.6.0.2.5/package/scripts/status_params.py
+++ b/ambari-server/src/main/resources/common-services/ZEPPELIN/0.6.0.2.5/package/scripts/status_params.py
@@ -24,5 +24,6 @@ from resource_management.libraries.script import Script
 config = Script.get_config()
 
 zeppelin_pid_dir = config['configurations']['zeppelin-env']['zeppelin_pid_dir']
+zeppelin_user = config['configurations']['zeppelin-env']['zeppelin_user']
+zeppelin_group = config['configurations']['zeppelin-env']['zeppelin_group']
 zeppelin_log_dir = config['configurations']['zeppelin-env']['zeppelin_log_dir']
-zeppelin_user = "zeppelin"


Mime
View raw message