GNUnet 0.21.1
gnunet_janitor Namespace Reference

Functions

def get_process_list ()
 
def main ()
 

Function Documentation

◆ get_process_list()

def gnunet_janitor.get_process_list ( )

Definition at line 35 of file gnunet_janitor.py.

36 result = []
37 pids = [pid for pid in os.listdir('/proc') if pid.isdigit()]
38 for pid in pids:
39 with open(os.path.join('/proc', pid, 'cmdline'), 'rb') as p:
40 cmdline = p.read().split('\x00')
41 if len(cmdline) > 0:
42 result.append((pid, cmdline[0]))
43 return result
44
45
def get_process_list()

Referenced by main().

Here is the caller graph for this function:

◆ main()

def gnunet_janitor.main ( )

Definition at line 46 of file gnunet_janitor.py.

46def main():
47 procs = get_process_list()
48 gnunet_procs = []
49 for p in procs:
50 if re.match(r'gnunet-.+', p[1]):
51 gnunet_procs.append(p)
52 for p in gnunet_procs:
53 if re.match(r'gnunet-service-arm', p[1]):
54 print("killing arm process {0:5} {1}".format(p[0], p[1]))
55 try:
57 except OSError as e:
58 print("failed: {0}".format(e))
59 pass
60 for p in gnunet_procs:
61 if not re.match(r'gnunet-service-arm', p[1]):
62 print("killing non-arm process {0:5} {1}".format(p[0], p[1]))
63 try:
65 except OSError as e:
66 print("failed: {0}".format(e))
67 pass
68
69
def safe_terminate_process_by_pid(pid, code)
Definition: terminate.py:33

References get_process_list(), consensus-simulation.int, main(), and terminate.safe_terminate_process_by_pid().

Referenced by main().

Here is the call graph for this function:
Here is the caller graph for this function: