From owner-freebsd-hackers@FreeBSD.ORG Mon May 5 11:14:21 2003 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A973837B401 for ; Mon, 5 May 2003 11:14:21 -0700 (PDT) Received: from ussenterprise.ufp.org (ussenterprise.ufp.org [208.185.30.210]) by mx1.FreeBSD.org (Postfix) with ESMTP id CBD0F43FAF for ; Mon, 5 May 2003 11:14:20 -0700 (PDT) (envelope-from bicknell@ussenterprise.ufp.org) Received: from ussenterprise.ufp.org (bicknell@localhost [127.0.0.1]) by ussenterprise.ufp.org (8.12.9/8.12.9) with ESMTP id h45IEKcL089193 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 5 May 2003 14:14:20 -0400 (EDT) Received: (from bicknell@localhost) by ussenterprise.ufp.org (8.12.9/8.12.9/Submit) id h45IEK4U089192; Mon, 5 May 2003 14:14:20 -0400 (EDT) Date: Mon, 5 May 2003 14:14:20 -0400 From: Leo Bicknell To: Kirk Strauser Message-ID: <20030505181420.GA88863@ussenterprise.ufp.org> Mail-Followup-To: Kirk Strauser , freebsd-hackers@freebsd.org References: <20030504100447.GU12792@freepuppy.bellavista.cz> <200305042336.h44NaoM7023683@gw.catspoiler.org> <20030504235059.GB42024@isnic.is> <20030505001955.GB92114@opiate.soulwax.net> <87r87d5vfg.fsf@pooh.honeypot.net> <87u1c94epk.fsf@pooh.honeypot.net> <20030505153116.GC74924@freepuppy.bellavista.cz> <87llxl4ce0.fsf@pooh.honeypot.net> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="UlVJffcvxoiEqYs2" Content-Disposition: inline In-Reply-To: <87llxl4ce0.fsf@pooh.honeypot.net> Organization: United Federation of Planets X-PGP-Key: http://www.ufp.org/~bicknell/ cc: freebsd-hackers@freebsd.org Subject: Re: Periodic email about security notifications X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 May 2003 18:14:21 -0000 --UlVJffcvxoiEqYs2 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In a message written on Mon, May 05, 2003 at 10:54:47AM -0500, Kirk Strause= r wrote: > There's nothing at all wrong with that. My goal, though was to > automatically add that functionality to *every* program that would > ordinarily connect to ftp.freebsd.org. With the exception of changing so= me > default values, no programs would have to be modified to get the new > rotating-mirror capability. I'm sure there is a better way to do this, but I've used this script before: #!/bin/sh ( for host in ftp1 ftp2 ftp3 ftp4 ftp5 ftp6 ftp7 ftp8 ftp9 do MS=3D`ping -q -c 2 $host.freebsd.org | tail -1 | sed -e 's,.*=3D [0-9.]= */,,' -e 's,/.*,,'` echo $MS | grep "0 packets received" > /dev/null 2>&1 if [ $? =3D 0 ] then echo "9999 $host.freebsd.org" else echo "$MS $host.freebsd.org" fi done ) | sort -n | head -1 | sed -e 's/.* //' If say, ftpmirrors.freebsd.org returned CNAME's for all active mirrors you could grab that with host or dig, pipe it into this code, and output the "closest" (by network time anyway) server. Make a file /etc/best_freebsd_mirror and make the ports run this script if it isn't set, and otherwise run it once a week in cron or something to catch updates. Anyway, method aside, making it so the user doesn't have to do anything, yet the load gets distributed and a "good", if not "the best" server is picked would be a good thing. --=20 Leo Bicknell - bicknell@ufp.org - CCIE 3440 PGP keys at http://www.ufp.org/~bicknell/ Read TMBG List - tmbg-list-request@tmbg.org, www.tmbg.org --UlVJffcvxoiEqYs2 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (FreeBSD) iD8DBQE+tqn8Nh6mMG5yMTYRAoZRAJsEgwCvDApnKMHCa4753NfLDDZ3hQCgggAN cOs3Qa3SrS1q0VYlN7Q+l/M= =OIoI -----END PGP SIGNATURE----- --UlVJffcvxoiEqYs2--