37 pids = [pid
for pid
in os.listdir(
'/proc')
if pid.isdigit()]
39 with open(os.path.join(
'/proc', pid,
'cmdline'),
'rb')
as p:
40 cmdline = p.read().split(
'\x00')
42 result.append((pid, cmdline[0]))
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]))
58 print(
"failed: {0}".format(e))
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]))
66 print(
"failed: {0}".format(e))
70 if __name__ ==
'__main__':
uint16_t len
length of data (which is always a uint32_t, but presumably this can be used to specify that fewer byt...
def safe_terminate_process_by_pid(pid, code)