code: def sigterm_handler(signum, frame):
      
      global _handled_term
      if not _handled_term:
          _handled_term = True
          if not _env_var_true("_REZ_QUIET_ON_SIG"):
              print >> sys.stderr, "Terminated by user"
          sigbase_handler(signum, frame)
docs: Exit gracefully on terminate.