def PosixShutdown():
 dev_process = GlobalProcess()
 children = dev_process.Children()
 for term_signal in (signal.SIGTERM, signal.SIGKILL):
  for child in children:
   if (child.process is None):
    continue
   if (child.process.returncode is not None):
    continue
   pid = child.process.pid
   try:
    logging.debug('posix kill %d with signal %d', pid, term_signal)
    os.kill(pid, term_signal)
   except OSError as err:
    logging.error('Error encountered sending pid %d signal %d:%s\n', pid, term_signal, err)
    break
  time.sleep(0.2)
 for child in children:
  if (child.process is None):
   continue
  if (child.process.returncode is not None):
   continue
  try:
   child.process.wait()
  except OSError as e:
   if (e.errno != errno.ECHILD):
    raise e

def PosixShutdown ( ) : dev_process = GlobalProcess ( ) children = dev_process . Children ( ) for term_signal in ( signal . SIGTERM , signal . SIGKILL ) : for child in children : if ( child . process is None ) : continue if ( child . process . returncode is not None ) : continue pid = child . process . pid try : logging . debug ( 'posix kill %d with signal %d' , pid , term_signal ) os . kill ( pid , term_signal ) except OSError as err : logging . error ( 'Error encountered sending pid %d signal %d:%s\n' , pid , term_signal , err ) break time . sleep ( 0.2 ) for child in children : if ( child . process is None ) : continue if ( child . process . returncode is not None ) : continue try : child . process . wait ( ) except OSError as e : if ( e . errno != errno . ECHILD ) : raise e
kills a posix process with os .