storm-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bo...@apache.org
Subject [1/3] storm git commit: create logs metadata dir when running securely
Date Thu, 16 Jul 2015 20:53:16 GMT
Repository: storm
Updated Branches:
  refs/heads/master af781c90e -> e2157678f


create logs metadata dir when running securely


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

Branch: refs/heads/master
Commit: f021d1fd0db14c4d446813783be908596e816be8
Parents: 27bc183
Author: Derek Dagit <derekd@yahoo-inc.com>
Authored: Tue Jun 9 18:31:38 2015 -0500
Committer: Derek Dagit <derekd@yahoo-inc.com>
Committed: Tue Jun 9 18:31:38 2015 -0500

----------------------------------------------------------------------
 storm-core/src/clj/backtype/storm/daemon/supervisor.clj | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/storm/blob/f021d1fd/storm-core/src/clj/backtype/storm/daemon/supervisor.clj
----------------------------------------------------------------------
diff --git a/storm-core/src/clj/backtype/storm/daemon/supervisor.clj b/storm-core/src/clj/backtype/storm/daemon/supervisor.clj
index 41533df..be8f682 100644
--- a/storm-core/src/clj/backtype/storm/daemon/supervisor.clj
+++ b/storm-core/src/clj/backtype/storm/daemon/supervisor.clj
@@ -596,9 +596,11 @@
   (let [file (get-log-metadata-file storm-id port)]
     ;;run worker as user needs the directory to have special permissions
     ;; or it is insecure
-    (when (and (not (conf SUPERVISOR-RUN-WORKER-AS-USER))
-               (not (.exists (.getParentFile file))))
-      (.mkdirs (.getParentFile file)))
+    (when (not (.exists (.getParentFile file)))
+      (if (conf SUPERVISOR-RUN-WORKER-AS-USER)
+        (do (FileUtils/forceMkdir (.getParentFile file))
+            (setup-storm-code-dir conf (read-supervisor-storm-conf conf storm-id) (.getCanonicalPath
(.getParentFile file))))
+        (.mkdirs (.getParentFile file))))
     (let [writer (java.io.FileWriter. file)
         yaml (Yaml.)]
       (try


Mime
View raw message