docs: def raiseMasterKilled(signum, _stack):
      """
      When a SIGTERM is received, raise the MasterKilled
      exception with an appropriate error message.
  
      :param int signum: the number of the received signal
      :param _stack: the current frame object, ignored
      """
      # Disable further CTRL-C to allow tasks revocation when Celery is used
      if OQ_DISTRIBUTE.startswith('celery'):
          signal.signal(signal.SIGINT, inhibitSigInt)
  
      msg = 'Received a signal %d' % signum
      if signum in (signal.SIGTERM, signal.SIGINT):
          msg = 'The openquake master process was killed manually'
  
      # kill the calculation only if os.getppid() != _PPID, i.e. the controlling
      # terminal died; in the workers, do nothing
      # NB: there is no SIGHUP on Windows
      if hasattr(signal, 'SIGHUP'):
          if signum == signal.SIGHUP:
              if os.getppid() == _PPID:
                  return
              else:
                  msg = 'The openquake master lost its controlling terminal'
  
      raise MasterKilled(msg)