Github user anandsubbu commented on a diff in the pull request:

    https://github.com/apache/metron/pull/894#discussion_r161184707
  
    --- Diff: 
metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/ELASTICSEARCH/5.6.2/package/scripts/elastic_master.py
 ---
    @@ -56,8 +59,28 @@ def status(self, env):
             import params
             env.set_params(params)
             Logger.info('Check status of Elasticsearch master node')
    -        status_cmd = "service elasticsearch status"
    -        Execute(status_cmd)
    +
    +        # return codes defined by LSB
    +        # 
http://refspecs.linuxbase.org/LSB_3.0.0/LSB-PDA/LSB-PDA/iniscrptact.html
    +        cmd = ('service', 'elasticsearch', 'status')
    +   
    +        rc, out = shell.call(cmd, sudo=True, quiet=False)
    +
    +        if rc == 3:
    --- End diff --
    
    On my 12-node CentOS 7, when I hit 'Stop Services', Kibana service stop 
still failed with the following error:
    
    ```
    stderr:   /var/lib/ambari-agent/data/errors-753.txt
    
    Traceback (most recent call last):
      File 
"/var/lib/ambari-agent/cache/common-services/KIBANA/5.6.2/package/scripts/kibana_master.py",
 line 153, in <module>
        Kibana().execute()
      File 
"/usr/lib/python2.6/site-packages/resource_management/libraries/script/script.py",
 line 332, in execute
        self.execute_prefix_function(self.command_name, 'after', env)
      File 
"/usr/lib/python2.6/site-packages/resource_management/libraries/script/script.py",
 line 350, in execute_prefix_function
        method(env)
      File 
"/usr/lib/python2.6/site-packages/resource_management/libraries/script/script.py",
 line 398, in after_stop
        status_method(env)
      File 
"/var/lib/ambari-agent/cache/common-services/KIBANA/5.6.2/package/scripts/kibana_master.py",
 line 118, in status
        raise ExecutionFailed(err_msg, rc, out)
    resource_management.core.exceptions.ExecutionFailed: Execution of 'service 
kibana status' returned 2
    stdout:   /var/lib/ambari-agent/data/output-753.txt
    
    2018-01-12 10:08:11,166 - Stop Kibana Master
    2018-01-12 10:08:11,166 - Execute['service kibana stop'] {}
    2018-01-12 10:08:12,251 - Waiting for actual component stop
    2018-01-12 10:08:12,251 - Status of the Master
    2018-01-12 10:08:12,251 - call[('service', 'kibana', 'status')] {'sudo': 
True, 'quiet': False}
    2018-01-12 10:08:12,285 - call returned (2, 'kibana is not running')
    
    Command failed after 1 tries
    ```
    This check only looks for exit status 3 alone.
    
    I made a local chance to treat any non-zero exit status as 
`ComponentIsNotRunning` and it worked fine.


---

Reply via email to