def check
      if pid = read_pid[:pid]
        if process_running?(pid)
          raise AlreadyRunning.new("#{@pid_file} already exists and process is running (pid: #{pid})")
        else
          Log.info("Removing stale pid file: #{@pid_file}")
          remove
        end
      end
      true
    end
def check
      if pid = read_pid[:pid]
        if process_running?(pid)
          raise AlreadyRunning.new("#{@pid_file} already exists and process is running (pid: #{pid})")
        else
          Log.info("Removing stale pid file: #{@pid_file}")
          remove
        end
      end
      true
    end
Initialize pid file location from agent identity and pid directory
 Check whether pid file can be created
 Delete any existing pid file if process is not running anymore

 === Return
 true:: Always return true

 === Raise
 AlreadyRunning:: If pid file already exists and process is running