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