Συντονιστής: konnn

child = subprocess.Popen(..., shell=True, ...)child.send_signal(signal.SIGSTOP)
child.send_signal(signal.SIGCONT)

kamar έγραψε:Δεν ξέρω αν βοηθά αυτό εδώ.
http://docs.python.org/library/subprocess.html#subprocess.Popen.pid έγραψε:Popen.pid
The process ID of the child process.
Note that if you set the shell argument to True, this is the process ID of the spawned shell.

ps --ppid parentid
ps h -o "pid" --pid parentid



$ traceroute www.readthedocs.org
traceroute to www.readthedocs.org (198.101.206.61), 30 hops max, 60 byte packets
1 192.168.10.1 (192.168.10.1) 0.273 ms 0.384 ms 0.485 ms
2 192.168.1.1 (192.168.1.1) 2.399 ms 2.456 ms 2.512 ms
3 195.252.96.220 (195.252.96.220) 8.377 ms 10.663 ms 13.114 ms
4 194.106.168.235 (194.106.168.235) 16.097 ms 18.502 ms 20.701 ms
5 79.101.105.101 (79.101.105.101) 27.372 ms 27.533 ms 28.266 ms
6 212.200.6.238 (212.200.6.238) 31.310 ms 7.682 ms 9.791 ms
7 212.200.5.105 (212.200.5.105) 22.322 ms 24.707 ms 27.122 ms
8 212.73.203.245 (212.73.203.245) 41.180 ms 44.269 ms 46.821 ms
9 ae-0-11.bar1.Vienna1.Level3.net (4.69.153.149) 49.547 ms 51.735 ms 54.436 ms
10 ae-12-12.ebr2.Frankfurt1.Level3.net (4.69.153.146) 63.825 ms 64.234 ms 64.782 ms
11 ae-72-72.csw2.Frankfurt1.Level3.net (4.69.140.22) 73.082 ms ae-82-82.csw3.Frankfurt1.Level3.net (4.69.140.26) 67.475 ms ae-72-72.csw2.Frankfurt1.Level3.net (4.69.140.22) 81.726 ms
12 ae-81-81.ebr1.Frankfurt1.Level3.net (4.69.140.9) 62.722 ms ae-71-71.ebr1.Frankfurt1.Level3.net (4.69.140.5) 32.479 ms ae-81-81.ebr1.Frankfurt1.Level3.net (4.69.140.9) 32.410 ms
13 ae-48-48.ebr2.Paris1.Level3.net (4.69.143.146) 43.689 ms 45.841 ms 48.506 ms
14 ae-42-42.ebr2.Washington1.Level3.net (4.69.137.54) 130.446 ms ae-44-44.ebr2.Washington1.Level3.net (4.69.137.62) 132.796 ms ae-43-43.ebr2.Washington1.Level3.net (4.69.137.58) 134.730 ms
15 ae-82-82.csw3.Washington1.Level3.net (4.69.134.154) 151.700 ms ae-62-62.csw1.Washington1.Level3.net (4.69.134.146) 149.966 ms ae-92-92.csw4.Washington1.Level3.net (4.69.134.158) 143.335 ms
16 ae-81-81.ebr1.Washington1.Level3.net (4.69.134.137) 148.986 ms ae-61-61.ebr1.Washington1.Level3.net (4.69.134.129) 149.493 ms ae-71-71.ebr1.Washington1.Level3.net (4.69.134.133) 150.669 ms
17 ae-2-2.ebr3.Atlanta2.Level3.net (4.69.132.85) 164.320 ms 166.433 ms 133.365 ms
18 ae-7-7.ebr3.Dallas1.Level3.net (4.69.134.21) 155.181 ms 156.481 ms 158.819 ms
19 ae-63-63.csw1.Dallas1.Level3.net (4.69.151.133) 164.351 ms ae-73-73.csw2.Dallas1.Level3.net (4.69.151.145) 163.891 ms ae-83-83.csw3.Dallas1.Level3.net (4.69.151.157) 166.814 ms
20 ae-4-90.edge2.Dallas3.Level3.net (4.69.145.204) 169.731 ms ae-3-80.edge2.Dallas3.Level3.net (4.69.145.140) 170.896 ms *
21 RACKSPACE-M.edge2.Dallas3.Level3.net (4.59.36.30) 182.543 ms 184.932 ms 188.382 ms
22 coreb.dfw1.rackspace.net (74.205.108.44) 187.889 ms 156.953 ms corea.dfw1.rackspace.net (74.205.108.42) 160.077 ms
23 core3.dfw1.rackspace.net (74.205.108.7) 296.912 ms 167.543 ms 172.372 ms
24 * * *
25 * * *
26 * * *
27 * * *
28 * * *
29 * * *
30 * * *$ ping ae-4-90.edge2.Dallas3.Level3.net
PING ae-4-90.edge2.Dallas3.Level3.net (4.69.145.204) 56(84) bytes of data.
64 bytes from ae-4-90.edge2.Dallas3.Level3.net (4.69.145.204): icmp_req=1 ttl=53 time=153 ms
64 bytes from ae-4-90.edge2.Dallas3.Level3.net (4.69.145.204): icmp_req=2 ttl=53 time=154 ms
64 bytes from ae-4-90.edge2.Dallas3.Level3.net (4.69.145.204): icmp_req=3 ttl=53 time=154 ms
64 bytes from ae-4-90.edge2.Dallas3.Level3.net (4.69.145.204): icmp_req=4 ttl=53 time=153 ms
64 bytes from ae-4-90.edge2.Dallas3.Level3.net (4.69.145.204): icmp_req=5 ttl=53 time=155 ms
^C
--- ae-4-90.edge2.Dallas3.Level3.net ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4001ms
rtt min/avg/max/mdev = 153.693/154.447/155.368/0.781 ms
$ ping RACKSPACE-M.edge2.Dallas3.Level3.net
PING RACKSPACE-M.edge2.Dallas3.Level3.net (4.59.36.50) 56(84) bytes of data.
^C
--- RACKSPACE-M.edge2.Dallas3.Level3.net ping statistics ---
10 packets transmitted, 0 received, 100% packet loss, time 9070ms
