Is the provided process name is currently running?
(process)
| 53 | |
| 54 | |
| 55 | def is_running(process): |
| 56 | """ |
| 57 | Is the provided process name is currently running? |
| 58 | """ |
| 59 | proc_list = subprocess.Popen(["pgrep", "-f", process], stdout=subprocess.PIPE) |
| 60 | for proc in proc_list.stdout: |
| 61 | if proc.decode("utf-8").rstrip() != str(os.getpid()) and proc.decode( |
| 62 | "utf-8" |
| 63 | ).rstrip() != str(os.getppid()): |
| 64 | return True |
| 65 | return False |
| 66 | |
| 67 | |
| 68 | def get_ips(ip_manager, all_dns_collection): |