You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ao...@apache.org on 2014/02/03 17:44:15 UTC

[2/5] git commit: AMBARI-4488. Storm "Restart All" fails (Arsen Babych via aonishuk)

AMBARI-4488. Storm "Restart All" fails (Arsen Babych via aonishuk)


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

Branch: refs/heads/trunk
Commit: 97783f71a61446e6605ef99f180b6a1fff1cd5a4
Parents: 65d16bd
Author: Andrew Onischuk <ao...@hortonworks.com>
Authored: Mon Feb 3 08:14:14 2014 -0800
Committer: Andrew Onischuk <ao...@hortonworks.com>
Committed: Mon Feb 3 08:44:00 2014 -0800

----------------------------------------------------------------------
 .../HDP/2.1.1/services/STORM/package/scripts/service.py  | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/97783f71/ambari-server/src/main/resources/stacks/HDP/2.1.1/services/STORM/package/scripts/service.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.1.1/services/STORM/package/scripts/service.py b/ambari-server/src/main/resources/stacks/HDP/2.1.1/services/STORM/package/scripts/service.py
index 721acf1..2626d1d 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.1.1/services/STORM/package/scripts/service.py
+++ b/ambari-server/src/main/resources/stacks/HDP/2.1.1/services/STORM/package/scripts/service.py
@@ -31,6 +31,7 @@ def service(
   import status_params
 
   pid_file = status_params.pid_files[name]
+  no_op_test = format("ls {pid_file} >/dev/null 2>&1 && ps `cat {pid_file}` >/dev/null 2>&1")
 
   if action == "start":
     cmd = ["/usr/bin/storm", name]
@@ -39,8 +40,6 @@ def service(
     else :
       crt_pid_cmd = format("pgrep -f \"^java.+backtype.storm.daemon.{name}$\" > {pid_file}")
 
-    no_op_test = format("ls {pid_file} >/dev/null 2>&1 && ps `cat {pid_file}` >/dev/null 2>&1")
-
     #Execute(cmd,
     #        not_if=no_op_test,
     #        user=params.storm_user
@@ -58,5 +57,11 @@ def service(
     )
 
   elif action == "stop":
-    cmd = format("kill `cat {pid_file}` >/dev/null 2>&1 && rm -f {pid_file}")
+    cmd = format("kill `cat {pid_file}` >/dev/null 2>&1")
     Execute(cmd)
+
+    Execute(format("! ({no_op_test})"),
+            tries=5,
+            try_sleep=3
+    )
+    Execute(format("rm -f {pid_file}"))