Hi,
I need to launch several remote jobs each at a precise moment using threads and SSH. So I write:
def dojob(hostname):
command = "echo Done"
p = Popen(['ssh','%s@%s' % (user, hostname), command], stdout=PIPE, shell=False)
output = p.communicate()[0].strip()
print output
[...]
fire_starter = [Timer(t, dojob, [y]) for t,y in zip(instant, hosts)]
for e in fire_starter:
e.start()
The code works, but it floods my OS with Zombies. Honestly, I believed that the communicate() method takes care of the child process, waiting for it to terminate. Where am I wrong ?