def shutdown(sups):
  global SHOULD_STOP
  SHOULD_STOP = True

  LOG.warn("Supervisor shutting down!")

  for pid in CHILD_PIDS:
    try:
      os.kill(pid, signal.SIGINT)
    except __HOLE__:
      pass

  LOG.warn("Waiting for children to exit for %d seconds..." % WAIT_FOR_DEATH)
  t = time.time()
  still_alive = False
  while time.time() < t + WAIT_FOR_DEATH:
    still_alive = False
    for sup in sups:
      sup.join(0.2)
      still_alive = still_alive or sup.isAlive()
    if not still_alive:
      break
  if still_alive:
    LOG.warn("Children have not exited after %d seconds. Killing them with SIGKILL." %
             WAIT_FOR_DEATH)
    for pid in CHILD_PIDS:
      try:
        os.kill(pid, signal.SIGKILL)
      except OSError:
        pass

  sys.exit(1)
dataset/ETHPy150Open cloudera/hue/desktop/core/src/desktop/supervisor.py/shutdown