Master Mirror Setup
Clone this wiki locally
Here's how the PGXN master mirror is set up.
It was created on a Ubuntu Linux box, so some of the details of where to get software may vary.
/etc/rsyncd.confand set up a read-only rsync path named "pgxn":
log file=/var/log/rsyncd pid file=/var/run/rsyncd.pid [pgxn] comment = PGXN Master mirror path = /var/www/master.pgxn.org use chroot = yes lock file = /var/lock/rsyncd read only = yes list = yes uid = nobody gid = nogroup strict modes = yes ignore errors = no ignore nonreadable = yes transfer logging = no timeout = 600 refuse options = checksum dry-run dont compress = *.gz *.tgz *.zip *.z *.rpm *.deb *.iso *.bz2 *.tbz
Much of this is boilerplate.
Create the user "rsync" and enable
useradd -m rsync -s /bin/bash perl -i -pe "s/RSYNC_ENABLE=false/RSYNC_ENABLE=true/" /etc/default/rsync /etc/init.d/rsyncd start
Now folks should be able to rsync the mirror from their own boxes with something like:
rsync -az --delete rsync://master.pgxn.org/pgxn /usr/local/pgxn
Next I wanted to be sure that mirrors are kept up-to-date. So I set up a daily cron job to run once a day that timestamps a file in the master mirror and then runs
check_mirrorsto validate all the mirrors.
# Update the timestamp. perl -le 'print scalar time' > /var/www/master.pgxn.org/meta/timestamp echo '# Do not delete this file' >> /var/www/master.pgxn.org/meta/timestamp # Check all mirrors. /usr/local/pgxn/bin/check_mirrors /var/www/master.pgxn.org/meta/mirrors.json
The script depends on the
mirrors.jsonfile, which lists all the existing mirrors. For now this file is edited manually, but will be maintained by the management application once it's written.