def stop_agent(agent_name)
      res = false
      if (pid_file = AgentConfig.pid_file(agent_name))
        name = human_readable_name(agent_name, pid_file.identity)
        if (pid = pid_file.read_pid[:pid])
          begin
            Process.kill('TERM', pid)
            res = true
            puts "#{name} stopped"
          rescue Errno::ESRCH
            puts "#{name} not running"
          end
        elsif File.file?(pid_file.to_s)
          puts "Invalid pid file '#{pid_file.to_s}' content: #{IO.read(pid_file.to_s)}"
        else
          puts "#{name} not running"
        end
      else
        puts "Non-existent pid file for #{agent_name}"
      end
      res
    end
def stop_agent(agent_name)
      res = false
      if (pid_file = AgentConfig.pid_file(agent_name))
        name = human_readable_name(agent_name, pid_file.identity)
        if (pid = pid_file.read_pid[:pid])
          begin
            Process.kill('TERM', pid)
            res = true
            puts "#{name} stopped"
          rescue Errno::ESRCH
            puts "#{name} not running"
          end
        elsif File.file?(pid_file.to_s)
          puts "Invalid pid file '#{pid_file.to_s}' content: #{IO.read(pid_file.to_s)}"
        else
          puts "#{name} not running"
        end
      else
        puts "Non-existent pid file for #{agent_name}"
      end
      res
    end
Stop agent process

 === Parameters
 agent_name(String):: Agent name

 === Return
 (Boolean):: true if process was stopped, otherwise false