mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-05-08 13:50:04 +02:00
check if process running for kill -9 slsReceiver fail
This commit is contained in:
parent
fb79ba768c
commit
9f4298ac15
@ -35,8 +35,8 @@ def killProcess(name):
|
|||||||
try:
|
try:
|
||||||
cmd = f"kill -9 {pid}"
|
cmd = f"kill -9 {pid}"
|
||||||
p = subprocess.run(['kill', '-9', pid])
|
p = subprocess.run(['kill', '-9', pid])
|
||||||
if p.returncode != 0:
|
if p.returncode != 0 and bool(checkIfProcessRunning(name)):
|
||||||
raise RuntimeException("'kill -9' failed for " + name)
|
raise RuntimeException(f"'kill -9' failed for {name} with pid {pid}")
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
Log(Fore.RED, f"Failed to kill process {name} pid:{pid}. Exception occured: [code:{e}, msg:{e.stderr}]")
|
Log(Fore.RED, f"Failed to kill process {name} pid:{pid}. Exception occured: [code:{e}, msg:{e.stderr}]")
|
||||||
raise
|
raise
|
||||||
|
Loading…
x
Reference in New Issue
Block a user