我有一个启动的进程,subprocess.Popen()
它意味着无限期地运行。我遇到的问题是该过程似乎在大约 20 秒后停止运行。果然,当我检查时top
,它表明该进程正在进入睡眠状态。当我手动运行命令时,这不会发生。
有谁知道我怎样才能阻止这种情况发生?
这是子流程调用:
aireplay = subprocess.Popen('aireplay-ng -3 -b ' + target.mac + ' ' + interface,
shell=True, stdout = subprocess.PIPE, stderr = DN)
time.sleep(5)
starttime = time.time()
ivs = 0
second = False
print 'Sending deauth to generate arps...'
send_deauth(target)
while time.time() - starttime < 1200:
targets = parsecsvfile('crackattempt')
print 'Captured ' + str(ivs) + ' ivs.'
print aireplay.poll()
if len(targets[0]) > 0:
target = targets[0][0]
if ivs > 20000:
break
else :
ivs = int(target.ivs)
time.sleep(1)