mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-09-08 02:39:22 +00:00
@@ -59,12 +59,12 @@ def check_pid_alive(pid) -> bool:
|
|||||||
content = decode_content(csv_ret)
|
content = decode_content(csv_ret)
|
||||||
content_list = content.strip().split("\r\n")
|
content_list = content.strip().split("\r\n")
|
||||||
if len(content_list) != 2:
|
if len(content_list) != 2:
|
||||||
notify_err_message(content)
|
print("check pid {} ret invalid: {}".format(pid, content))
|
||||||
return False
|
return False
|
||||||
ret_pid = content_list[1].split(",")[1].strip('"')
|
ret_pid = content_list[1].split(",")[1].strip('"')
|
||||||
return str(pid) == ret_pid
|
return str(pid) == ret_pid
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
notify_err_message(e)
|
print("check pid {} err: {}".format(pid, e))
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
@@ -73,7 +73,7 @@ def wait_pid(pid):
|
|||||||
time.sleep(5)
|
time.sleep(5)
|
||||||
ok = check_pid_alive(pid)
|
ok = check_pid_alive(pid)
|
||||||
if not ok:
|
if not ok:
|
||||||
notify_err_message("程序退出")
|
print("pid {} is not alive".format(pid))
|
||||||
break
|
break
|
||||||
|
|
||||||
|
|
||||||
|
@@ -59,14 +59,12 @@ def check_pid_alive(pid) -> bool:
|
|||||||
content = decode_content(csv_ret)
|
content = decode_content(csv_ret)
|
||||||
content_list = content.strip().split("\r\n")
|
content_list = content.strip().split("\r\n")
|
||||||
if len(content_list) != 2:
|
if len(content_list) != 2:
|
||||||
notify_err_message(content)
|
print("check pid {} ret invalid: {}".format(pid, content))
|
||||||
time.sleep(2)
|
|
||||||
return False
|
return False
|
||||||
ret_pid = content_list[1].split(",")[1].strip('"')
|
ret_pid = content_list[1].split(",")[1].strip('"')
|
||||||
return str(pid) == ret_pid
|
return str(pid) == ret_pid
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
notify_err_message(e)
|
print("check pid {} err: {}".format(pid, e))
|
||||||
time.sleep(2)
|
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
@@ -75,8 +73,7 @@ def wait_pid(pid):
|
|||||||
time.sleep(5)
|
time.sleep(5)
|
||||||
ok = check_pid_alive(pid)
|
ok = check_pid_alive(pid)
|
||||||
if not ok:
|
if not ok:
|
||||||
notify_err_message("程序退出")
|
print("pid {} is not alive".format(pid))
|
||||||
time.sleep(2)
|
|
||||||
break
|
break
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user