Jelajahi Sumber

AMBARI-14973. ambari-agent upstart script restart triggers the restart of hbase specific JVM processes (aonishuk)

Andrew Onishuk 9 tahun lalu
induk
melakukan
ef1b98b3c7

+ 4 - 1
ambari-agent/src/main/python/ambari_agent/PythonExecutor.py

@@ -166,6 +166,9 @@ class PythonExecutor(object):
       else:
         structured_out = {}
     return out, error, structured_out
+  
+  def preexec_fn(self):
+    os.setpgid(0, 0)
 
   def launch_python_subprocess(self, command, tmpout, tmperr):
     """
@@ -181,7 +184,7 @@ class PythonExecutor(object):
 
     return subprocess.Popen(command,
       stdout=tmpout,
-      stderr=tmperr, close_fds=close_fds, env=command_env)
+      stderr=tmperr, close_fds=close_fds, env=command_env, preexec_fn=self.preexec_fn)
 
   def isSuccessfull(self, returncode):
     return not self.python_process_has_been_killed and returncode == 0