Repository: ambari
Updated Branches:
  refs/heads/branch-2.1 8868dbcbf -> 630e160d3
  refs/heads/trunk 5e27d2a78 -> f76d28bb9


AMBARI-12199. With non-root agent RU restart NN fails (aonishuk)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/f76d28bb
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/f76d28bb
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/f76d28bb

Branch: refs/heads/trunk
Commit: f76d28bb98e89692b4b4164f3931c179072af620
Parents: 5e27d2a
Author: Andrew Onishuk <[email protected]>
Authored: Mon Jun 29 14:30:27 2015 +0300
Committer: Andrew Onishuk <[email protected]>
Committed: Mon Jun 29 14:30:27 2015 +0300

----------------------------------------------------------------------
 .../HDFS/2.1.0.2.0/package/scripts/utils.py             | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/f76d28bb/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/utils.py
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/utils.py
 
b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/utils.py
index 263bdec..2360d7a 100644
--- 
a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/utils.py
+++ 
b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/utils.py
@@ -114,13 +114,17 @@ def kill_zkfc(zkfc_user):
   if params.dfs_ha_enabled:
     zkfc_pid_file = get_service_pid_file("zkfc", zkfc_user)
     if zkfc_pid_file:
-      check_process = as_user(format("ls {zkfc_pid_file} > /dev/null 2>&1 && 
ps -p `cat {zkfc_pid_file}` > /dev/null 2>&1"), user=params.hdfs_user)
+      check_process = as_user(format("ls {zkfc_pid_file} > /dev/null 2>&1 && 
ps -p `cat {zkfc_pid_file}` > /dev/null 2>&1"), user=zkfc_user)
       code, out = shell.call(check_process)
       if code == 0:
         Logger.debug("ZKFC is running and will be killed to initiate namenode 
failover.")
-        kill_command = format("{check_process} && kill -9 `cat 
{zkfc_pid_file}` > /dev/null 2>&1")
-        Execute(kill_command)
-        Execute(format("rm -f {zkfc_pid_file}"))
+        kill_command = format("kill -9 `cat {zkfc_pid_file}`")
+        Execute(kill_command,
+             user=zkfc_user
+        )
+        File(zkfc_pid_file,
+             action = "delete",
+        )
         return True
   return False
 

Reply via email to