ATLAS-2971: Atlas fails to start if there is a empty pid file
Signed-off-by: Sarath Subramanian <ssubramanian@hortonworks.com>
diff --git a/distro/src/bin/atlas_start.py b/distro/src/bin/atlas_start.py
index 25f1959..963faf4 100755
--- a/distro/src/bin/atlas_start.py
+++ b/distro/src/bin/atlas_start.py
@@ -101,13 +101,13 @@
pf = file(atlas_pid_file, 'r')
pid = pf.read().strip()
pf.close()
-
- if mc.exist_pid((int)(pid)):
- if is_setup:
- print "Cannot run setup when server is running."
- mc.server_already_running(pid)
- else:
- mc.server_pid_not_running(pid)
+ if pid != "":
+ if mc.exist_pid((int)(pid)):
+ if is_setup:
+ print "Cannot run setup when server is running."
+ mc.server_already_running(pid)
+ else:
+ mc.server_pid_not_running(pid)
if is_hbase and mc.is_hbase_local(confdir):
print "configured for local hbase."