Commit a39424ac authored by ibuler's avatar ibuler

[Update] 更新jms脚本

parent 759760e7
...@@ -80,10 +80,14 @@ def get_log_file_path(service): ...@@ -80,10 +80,14 @@ def get_log_file_path(service):
def get_pid(service): def get_pid(service):
pid_file = get_pid_file_path(service) pid_file = get_pid_file_path(service)
pid = 0
if os.path.isfile(pid_file): if os.path.isfile(pid_file):
with open(pid_file) as f: with open(pid_file) as f:
try:
return int(f.read().strip()) return int(f.read().strip())
return 0 except ValueError:
pass
return pid
def is_running(s, unlink=True): def is_running(s, unlink=True):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment