code: def get_processid(config):
      
      pidfile = config.get('daemon', 'pidfile', fallback=None)
      if pidfile is None:
          raise ValueError("Configuration doesn't have pidfile option!")
  
      try:
          with open(pidfile, 'r') as _file:
              pid = _file.read().rstrip()
              try:
                  pid = int(pid)
              except ValueError:
                  raise ValueError("stale pid file with invalid data:{}"
                                   .format(pid))
              else:
                  if pid in [-1, 1]:
                      raise ValueError("invalid PID ({})".format(pid))
                  else:
                      return pid
      except OSError as exc:
          if exc.errno == 2:
              print("CRITICAL: anycast-healthchecker could be down as pid file "
                    "{} doesn't exist".format(pidfile))
              sys.exit(2)
          else:
              raise ValueError("error while reading pid file:{}".format(exc))
docs: Return process id of anycast-healthchecker.
  
      Arguments:
          config (obj): A configparser object with the configuration of
          anycast-healthchecker.
  
      Returns:
          The process id found in the pid file
  
      Raises:
          ValueError in the following cases
          - pidfile option is missing from the configuration
          - pid is either -1 or 1
          - stale pidfile, either with no data or invalid data
          - failure to read pidfile