mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Handle cases where the process is gone or zombified
This commit is contained in:
parent
4925172a28
commit
561a5c4bdf
1 changed files with 4 additions and 1 deletions
|
@ -18,7 +18,10 @@ def _get_running_named_salt_pid(process_name):
|
|||
|
||||
pids = []
|
||||
for proc in psutil.process_iter():
|
||||
cmdl_strg = " ".join(str(element) for element in proc.cmdline())
|
||||
try:
|
||||
cmdl_strg = " ".join(str(element) for element in proc.cmdline())
|
||||
except (psutil.ZombieProcess, psutil.NoSuchProcess):
|
||||
continue
|
||||
if process_name in cmdl_strg:
|
||||
pids.append(proc.pid)
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue