瀏覽代碼

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

Andrew Onishuk 9 年之前
父節點
當前提交
ef1b98b3c7
共有 1 個文件被更改,包括 4 次插入1 次删除
  1. 4 1
      ambari-agent/src/main/python/ambari_agent/PythonExecutor.py

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

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