def process_or_children_is_defunct(ppid):
 defunct = False
 try:
  pids = get_children_pids(ppid)
 except error.CmdError:
  return True
 for pid in pids:
  cmd = ('ps --no-headers -o cmd %d' % int(pid))
  proc_name = system_output(cmd, ignore_status=True)
  if ('<defunct>' in proc_name):
   defunct = True
   break
 return defunct

def process_or_children_is_defunct ( ppid ) : defunct = False try : pids = get_children_pids ( ppid ) except error . CmdError : return True for pid in pids : cmd = ( 'ps --no-headers -o cmd %d' % int ( pid ) ) proc_name = system_output ( cmd , ignore_status = True ) if ( '<defunct>' in proc_name ) : defunct = True break return defunct
verify if any processes from ppid is defunct .