atlas-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From venkat...@apache.org
Subject [04/50] [abbrv] incubator-atlas git commit: python scripts modified to account for pid file env variable
Date Wed, 13 May 2015 21:27:45 GMT
python scripts modified to account for pid file env variable


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

Branch: refs/remotes/origin/master
Commit: fc4dfcfe0ac0b071a714fc154716320ad06f4347
Parents: 2fa785c
Author: Jon Maron <jmaron@hortonworks.com>
Authored: Thu Apr 30 16:19:43 2015 -0400
Committer: Jon Maron <jmaron@hortonworks.com>
Committed: Thu Apr 30 16:19:43 2015 -0400

----------------------------------------------------------------------
 src/bin/metadata_config.py | 7 ++++++-
 src/bin/metadata_start.py  | 2 +-
 src/bin/metadata_stop.py   | 2 +-
 3 files changed, 8 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/fc4dfcfe/src/bin/metadata_config.py
----------------------------------------------------------------------
diff --git a/src/bin/metadata_config.py b/src/bin/metadata_config.py
index fd2ec87..cc5b3d4 100755
--- a/src/bin/metadata_config.py
+++ b/src/bin/metadata_config.py
@@ -30,9 +30,10 @@ CONF = "conf"
 LOG="logs"
 WEBAPP="server" + os.sep + "webapp"
 DATA="data"
-ENV_KEYS = ["JAVA_HOME", "METADATA_OPTS", "METADATA_LOG_DIR", "METADATA_CONF", "METADATACPPATH",
"METADATA_DATA_DIR", "METADATA_HOME_DIR", "METADATA_EXPANDED_WEBAPP_DIR"]
+ENV_KEYS = ["JAVA_HOME", "METADATA_OPTS", "METADATA_LOG_DIR", "METADATA_PID_DIR", "METADATA_CONF",
"METADATACPPATH", "METADATA_DATA_DIR", "METADATA_HOME_DIR", "METADATA_EXPANDED_WEBAPP_DIR"]
 METADATA_CONF = "METADATA_CONF"
 METADATA_LOG = "METADATA_LOG_DIR"
+METADATA_PID = "METADATA_PID_DIR"
 METADATA_WEBAPP = "METADATA_EXPANDED_WEBAPP_DIR"
 METADATA_OPTS = "METADATA_OPTS"
 METADATA_DATA = "METADATA_DATA_DIR"
@@ -62,6 +63,10 @@ def logDir(dir):
     localLog = os.path.join(dir, LOG)
     return os.environ.get(METADATA_LOG, localLog)
 
+def pidFile(dir):
+    localPid = os.path.join(dir, LOG)
+    return os.path.join(os.environ.get(METADATA_PID, localPid), 'metadata.pid')
+
 def dataDir(dir):
     data = os.path.join(dir, DATA)
     return os.environ.get(METADATA_DATA, data)

http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/fc4dfcfe/src/bin/metadata_start.py
----------------------------------------------------------------------
diff --git a/src/bin/metadata_start.py b/src/bin/metadata_start.py
index 73cd251..17e3600 100755
--- a/src/bin/metadata_start.py
+++ b/src/bin/metadata_start.py
@@ -51,7 +51,7 @@ def main():
                        + os.path.join(web_app_dir, "metadata", "WEB-INF", "lib", "*" )  +
p \
                        + os.path.join(metadata_home, "libext", "*")
 
-    metadata_pid_file = os.path.join(logdir, "metadata.pid")
+    metadata_pid_file = mc.pidFile(metadata_home)
 
     if os.path.isfile(metadata_pid_file):
         print "%s already exists, exiting" % metadata_pid_file

http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/fc4dfcfe/src/bin/metadata_stop.py
----------------------------------------------------------------------
diff --git a/src/bin/metadata_stop.py b/src/bin/metadata_stop.py
index 3d90b7b..686fabd 100755
--- a/src/bin/metadata_stop.py
+++ b/src/bin/metadata_stop.py
@@ -28,7 +28,7 @@ def main():
     piddir = mc.dirMustExist(mc.logDir(metadata_home))
     mc.executeEnvSh(confdir)
 
-    metadata_pid_file = os.path.join(piddir, "metadata.pid")
+    metadata_pid_file = mc.pidFile(metadata_home)
 
     try:
         pf = file(metadata_pid_file, 'r')


Mime
View raw message