# File lib/mongrel_cluster/init.rb, line 103
    def stop
      read_options
    
      argv = [ "mongrel_rails" ]
      argv << "stop"
      argv << "-c #{@options["cwd"]}" if @options["cwd"]
      argv << "-f" if @force
      cmd = argv.join " "

      @ports.each do |port|
        pid = check_process(port)        
        if @clean && pid && !pid_file_exists?(port)       
          log "missing pid_file: killing mongrel_rails port #{port}, pid #{pid}"
          Process.kill("KILL", pid.to_i)  
        end
        
        if !check_process(port)
          log "already stopped port #{port}"                   
          next       
        end

        exec_cmd = cmd + " -P #{port_pid_file(port)}"
        log "stopping port #{port}"          
        log_verbose exec_cmd
        output = `#{exec_cmd}`
        log_error output unless $?.success?
        
      end
    end