Hi all,

the CVS mirror 2 is now up and working.
The
cvs server: cannot open /root/.cvsignore: Permission denied
error message isn't fixed yet, though.
(I'll need to work that out with the other admin next week)

But the rest seems to work perfectly.
The CVS mails this morning automatically triggered the update process.

I'll let Douglas add a page to WineHQ describing the setup
of CVS mirrors soon.

Some words about load balancing:
I wrote some scripts for automatic selection of the fastest (ping) mirror.

/etc/cvsroots.wine:
:pserver:[EMAIL PROTECTED]:/home/wine
:pserver:[EMAIL PROTECTED]:/home/wine
:pserver:[EMAIL PROTECTED]:/home/wine

/usr/local/bin/find_cvsroot:
echo Determining best CVS host...
CVSHOSTS=`cat /etc/cvsroots.wine`
HNAME=`echo "$CVSHOSTS"|cut -f2 -d"@"|cut -f1 -d":"`
HOST=`echo $HNAME`
OUTPUT=`fping -C 1 -a $HOST 2>&1|grep ":"`
TIMES=`echo "$OUTPUT"|tr -d ' '|cut -f2 -d":"|cut -f1 -d"."`
let MIN=65535
let i=1
for PING in $TIMES; do
  if [ $PING != "-" ]; then
    let PTIME=$PING
    if [ $PTIME -lt $MIN ]; then
      MIN=$PTIME
      NR=$i
    fi
  fi
  let i=$i+1
done
# get the CVSROOT line of the host that is best
export CVSROOT=`echo "$CVSHOSTS"|head -$NR|tail -1`
echo Using CVSROOT $CVSROOT

/usr/local/bin/smartcvs:
# figure out the best CVSROOT setting
. find_cvsroot
cvs -d $CVSROOT login
cvs -d $CVSROOT $@

just use "smartcvs" as you would use the "cvs" command, except for the login
thing, which smartcvs uses automatically.

Note that you need the "fping" package installed for the scripts to work.

Andreas Mohr

Reply via email to