More or less, I just do a csup on the host to update the ports tree. Fetching the distfiles happens automatically when I start building things inside the jail. I currently use portmaster to do all the building. Add the -g switch to it so it'll create packages of the built ports.FreeBIE said:OK, that looks nice. How do you fetch these files? I imagine that you use postsnap fetch/update for the local repository of ports as one would normally. Am I right?
I simply use NFS to mount the read-only exported /storage/FreeBSD/packages directory. My update strategy mainly consists of just nuking all installed packages with pkg_delete -a after which I just pkg_add everything I need. Doing this on my workstation (which has the most installed packages) usually takes about 20-30 min.How are these files then fetched by your other servers? I guess you configure portsnap.conf like SERVERNAME=myupdateserver.mydomain.com. Is your portsnap server just an anonymous ftp server? How do you generate the public/private keys?
FreeBIE said:Hi All,
How do I go about setting up a mirrored update/ports server? Preferably a private one but I might even go so far as to set up a public one if that's what it takes to get one.
Thanks
WRKDIRPREFIX?= /data/work
DISTDIR?= /data/distfiles
PACKAGES?= /data/packages
[portsnap]
path = /var/db/portsnap
comment = FreeBSD portsnap files
max connections = 2
use chroot = yes
read only = true
refuse options = c delete
#!/bin/sh
# file: update_ports_client.sh
#
BASE_DIR=/root
RSYNCD_MASTER=MasterServer/portsnap/
PORTSNAP_DIR=/var/db/portsnap/
UPDATE_LOG=${BASE_DIR}/.portsnap_update_$(date +%F).log
MAX_AGE="+7d"
[ -d ${PORTSNAP_DIR} ] || ( /bin/mkdir -p ${PORTSNAP_DIR} || echo "`hostname`: faild to create ${PORTSNAP_DIR}" && exit 2)
DMZS=0
hostname | grep -v dmz 2>&1 > /dev/null
DMZS=$?
if [ ${DMZS} -eq 0 ]; then
rsync -4 -a -q --delete --no-motd rsync://${RSYNCD_MASTER} ${PORTSNAP_DIR}
fi
echo -n "$(hostname) ==> portsnap update .... "
portsnap update >> ${UPDATE_LOG}
RETVAL=$?
if [ ${RETVAL} -eq 0 ];then
echo " OK done"
else
echo " failed"
fi
# cleanup old logs
/usr/bin/find ${BASE_DIR} -maxdepth 1 -name .portsnap_update_20\*.log -mtime ${MAX_AGE} -delete 2>/dev/null 1>/dev/null
/usr/sbin/pkg_version -vIL=