MCPcopy Create free account
hub / github.com/adobe/Marinus / is_running

Function is_running

python3_cron_scripts/zgrab_http_ip.py:55–65  ·  view source on GitHub ↗

Is the provided process name is currently running?

(process)

Source from the content-addressed store, hash-verified

53
54
55def 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
68def get_ips(ip_manager, all_dns_collection):

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected