There has been countless suggestions on more effective and mainly faster mirroring of your packages that you need. If you have two or more boxes that have gentoo installed then you will be extremely pleased at how this little tip can speed up your maintanance!
How does this sound:
emerge --sync in less than a minute!
emerge -f package in less than a minute!
Got your attention? GOOD!
What we need to do is create a local Gentoo mirror for all our other Gentoo boxes.
Choose the box that has the most stuff installed on it, then we will be certain that most of what the other boxes need is allready available!
RSYNC MIRROREdit the following file on the server (the one we discussed above):
CODE
nano /etc/rsyncd.conf
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/app-admin/gentoo-rsync-mirror/files/rsyncd.conf,v 1.6 2004/07/14 21:12:47 agriffis Exp $
uid = nobody
gid = nobody
use chroot = yes
max connections = 2
pid file = /var/run/rsyncd.pid
motd file = /etc/rsync/rsyncd.motd
# transfer logging = no
log format = %t %a %m %f %b
syslog facility = local3
timeout = 300
hosts allow = 192.168.0.0/255.255.255.0
hosts deny = *
[distfiles]
path = /usr/portage/distfiles
comment = Gentoo Linux Distfiles
exclude = cvs-src
[gentoo-portage]
path = /usr/portage
comment = Gentoo Linux Portage tree mirror
exclude = distfiles/ packages/
And now run:
CODE
/etc/init.d/rsyncd start
# And if you want this service to always be available
rc-update add rsyncd default
CLIENTSNow we edit the clients:
CODE
nano -w /etc/make.conf
# Remove comments form the following:
PORTDIR=/usr/portage
DISTDIR=${PORTDIR}/distfiles
# Comment out:
# Gentoo_mirrors="......"
# Add this
FETCHCOMMAND=“rsync rsync://<your Portage gateway’s IP or DNS>/distfiles/\${FILE} ${DISTDIR}”
SYNC="rsync://<your server ip here>/gentoo-portage"
As easy as that, now emerge --sync the server once a day and after that you can sync the clients and watch speed at work!
To explain:FETCHCOMMAND=“rsync rsync://<your Portage gateway’s IP or DNS>/gentoo-packages/\${FILE} ${DISTDIR}”Quote from another source:
QUOTE
Missing even one character in the line above would result in failed emerge process so let’s review:
-- The FETCHCOMMAND feature of Portage allows you to specify a wide variety of methods to retrieve Gentoo packages from your Portage gateway. Kudos to the Gentoo folks the flexibility is great!
-- rsync -v is telling Portage to use the rsync program to get the file. The “-v” is optional as are many other settings you could apply. Check the man pages (#man rsync) for more choices.
-- rsync:// This is telling rsync that you need to reach across the network using the rsync protocol
-- <your gateway address> If you have DNS working than put in the name of your server otherwise use its IP. Do NOT include the greater or less than signs (<>).
-- /distfiles Recall that this is the name of the module you specified in the rsyncd.conf file on your Portage gateway. The module contains a path that points to the gateway’s local Gentoo package directory.
-- /\${FILE} This variable contains the file name emerge is trying to obtain. Note the forward slash and backslash combination this is important.
-- ${DISTDIR} This variable tells rsync were to put the files on the local (client) machine. There should be a space between it and the ${FILE} variable
-- Note the quotes around everything after the equals sign.
Output using this method? Here's a snip:
CODE
>>> Downloading http://distfiles.gentoo.org/distfiles/libmad-0.15.1b.tar.gz
-=HAhahahaha=-
You got hax0red by my server!!!
myworld( at )haxed.net
And so with one service we kill two birds! Syncing and getting distfiles!
Enjoy!
This post has been edited by My_World: Jun 6 2005, 08:08 PM