anandsubbu commented on a change in pull request #1308: METRON-1945: Metron 
MPack support for Knox SSO setup
URL: https://github.com/apache/metron/pull/1308#discussion_r243574251
 
 

 ##########
 File path: 
metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/METRON/CURRENT/package/scripts/metron_service.py
 ##########
 @@ -588,3 +589,35 @@ def check_indexer_parameters():
 
     if len(missing) > 0:
       raise Fail("Missing required indexing parameters(s): indexer={0}, 
missing={1}".format(indexer, missing))
+
+def install_metron_knox(params):
+    if os.path.exists(params.knox_home):
+        template = """export KNOX_HOME={0}; \
+            export KNOX_USER={1}; \
+            export KNOX_GROUP={2}; \
+            {3}/bin/install_metron_knox.sh; \
+            unset KNOX_USER; \
+            unset KNOX_GROUP; \
+            unset KNOX_HOME;"""
+        cmd = template.format(params.knox_home, params.knox_user, 
params.knox_group, params.metron_home)
+
+        Execute(cmd)
+
+def is_metron_knox_installed(params):
+    return os.path.isfile(params.metron_knox_installed_flag_file)
+
+def set_metron_knox_installed(params):
 
 Review comment:
   I checked this behavior on a kerberized environment. Here is the folder 
structure on a node _without_ Metron services:
   
   ```
   [root@metron-1 ~]# cd /usr/metron/0.7.0/
   [root@metron-1 0.7.0]# ll
   total 4
   -rwxr-xr-x. 1 metron metron 688 Dec 21 10:18 client_jaas.conf
   ```
   Restarting Metron Client service is still failing with this error:
   ```
       raise Fail("Applying %s failed, parent directory %s doesn't exist" % 
(self.resource, dirname))
   resource_management.core.exceptions.Fail: Applying 
File['/usr/metron/0.7.0/config/zookeeper/../metron_knox_installed'] failed, 
parent directory /usr/metron/0.7.0/config/zookeeper/.. doesn't exist
   
   ```
   
   The `config/zookeeper` within `$METRON_HOME` needs to be created before we 
write the flag file. 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to