ambari-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Greg Hill (JIRA)" <j...@apache.org>
Subject [jira] [Created] (AMBARI-12238) ambari-server stop kills parent process
Date Wed, 01 Jul 2015 15:19:04 GMT
Greg Hill created AMBARI-12238:
----------------------------------

             Summary: ambari-server stop kills parent process
                 Key: AMBARI-12238
                 URL: https://issues.apache.org/jira/browse/AMBARI-12238
             Project: Ambari
          Issue Type: Bug
          Components: ambari-server
    Affects Versions: 2.0.1, 2.1.0
            Reporter: Greg Hill


When you do ambari-server stop inside a script, it kills the calling script as well.  This
is because ambari-server stop kills the entire process group, but ambari-server start does
not detach itself from the parent process.

'stop' kills the whole process group:

https://github.com/apache/ambari/blob/trunk/ambari-server/src/main/python/ambari-server.py#L145

'start' does not detach from its parent:

https://github.com/apache/ambari/blob/trunk/ambari-server/src/main/python/ambari_server_main.py#L276

If you add an os.setsid() call to the start process, I think that would fix the bug, but more
research/testing is needed:

https://docs.python.org/2/library/os.html#os.setsid




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message