0

i am trying to find a running process by it's but zombie process interrupt me- because of it i can't Determine if the process itself is running.

for pid in psutil.pids():
    try:
        p = psutil.Process(pid)
        if name in p.name():
            return True
        else:
            pass
    except:
        return Fals
user4719989
  • 107
  • 1
  • 4
  • 11
  • Look this question,it will give an answer what your looking for. http://stackoverflow.com/questions/2760652/how-to-kill-or-avoid-zombie-processes-with-subprocess-module# – danglingpointer Mar 26 '17 at 10:38

1 Answers1

0

However what you can do,

  • You need to .join() on your processes in a worker Queue, which will lock them to the calling application until all of them succeed or kill when the parent is killed, and run them in daemon mode.

  • Check the parent joins its children, to avoid zombies. Check this out, it might give some insight about multiprocessing in python

  • You can check whether a child is still running with the is_alive() member function.

danglingpointer
  • 4,708
  • 3
  • 24
  • 42