    # File lib/phusion_passenger/admin_tools/server_instance.rb, line 192
            def connect(role_or_username, password = nil)
                    if role_or_username.is_a?(Symbol)
                            case role_or_username
                            when :passenger_status
                                    username = "_passenger-status"
                                    begin
                                            filename = "#{@generation_path}/passenger-status-password.txt"
                                            password = File.open(filename, "rb") do |f|
                                                    f.read
                                            end
                                    rescue Errno::EACCES
                                            raise RoleDeniedError
                                    end
                            else
                                    raise ArgumentError, "Unsupported role #{role_or_username}"
                            end
                    else
                            username = role_or_username
                    end

                    @client = MessageClient.new(username, password, "unix:#{@generation_path}/socket")
                    begin
                            yield self
                    ensure
                            @client.close
                    end
            end