Great how-to I'm setting this up ony my virtual Debian server right now. I copied my local /usr/portage to /var/portage on the Debian server and edited the config files accordingly. My only question now is - how do I rsync the portage tree that is in /var/portage on the Debian box? There's no "emerge sync" of course. I'm doing this service mainly for a few friends and some people on my university, so I was thinking I could sync the tree on the Debian box perhaps two or four times a day, and me & my friends can sync to this server. But again, how do I sync the Debian box with an "real" official portage mirror?

I am pretty sure you have rsync on the debain system so just look at /etc/make.conf to see the rsync command used by gentoo and adapt the paths etc. to do the same thing on your Debox.

HTH

PS also do regular tar of both the portage tree and distfiles if you have room. This will be a great help to you when portage rsyncs with broken packages and deletes the working ones from your system's portage. _________________Linux, because I'd rather own a free OS than steal one that's not worth paying for.
Gentoo because I'm a masochist
AthlonXP-M on A7N8X. Portage ~x86

The original reason I wrote this howto is because that official howto was confusing and gave bad info for home/casual users. I created this howto and suggested changes to the official howto. Last I looked, most of the problems with the official howto are fixed. Many users could still be confused so my howto is still relavent.

RSYNC="/usr/bin/rsync"
OPTS="--quiet --recursive --links --perms --times --devices --delete --timeout=300"
#Uncomment the following line only if you have been granted access to rsync1.us.gentoo.org
#SRC="rsync://rsync1.us.gentoo.org/gentoo-portage"
#If you are waiting for access to our master mirror, select one of our mirrors to mirror from:
SRC="rsync://rsync2.de.gentoo.org/gentoo-portage"
DST="/space/gentoo/rsync/"

I have just followed the instructions as given at the beginning of this thread, and right at this instant my brother's laptop is syncing from mine. This will certainly save doubling up download time from the internet.
I had everything work fine, and I copied the config files exactly as given.

Shouldn't I see this process owned by "nobody" as per the rsyncd.conf file settings? Also, is there a way to check that a process is really running inside a chroot? I honestly don't know that much daemons so if I am confused feel free to set me straight, but I am concerned about the security of the current setup.

The difference is the daemon starts as root but changes into "nobody" when a user actually connects. Only root can change into another user so that makes sense. In my example, You see the program running as "nobody" because a user is actually connected.....

Verifying the chroot, I don't know how to do.. But here is the man page info:

Quote:

use chroot
If "use chroot" is true, the rsync server will chroot to the
"path" before starting the file transfer with the client. This
has the advantage of extra protection against possible implemen-
tation security holes, but it has the disadvantages of requiring
super-user privileges, of not being able to follow symbolic
links outside of the new root path when reading, and of implying
the --numeric-ids option because /etc/passwd becomes inaccessi-
ble. When "use chroot" is false, for security reasons symlinks
may only be relative paths pointing to other files within the
root path, and leading slashes are removed from absolute paths.
The default for "use chroot" is true.

This man page is for a newer version of rsync. Older versions don't have "use chroot" default to true, that is why it's still in the config.

So thats what I find. Rsync runs as root initially in order to be able to change to "nobody" and run in a "chroot" when a user is actually connected, just like its supposed to...

I have to confess I have been bad! I have 10 clients I was updating by going to official mirrors. Thanks for making this tutorial, I have beeen meaning to do this forever but never got around to it. Now I can do my part to relieve the load.

Thanks for posting this helpful guide. In following it, I very easily set-up an RSYNC server on my home LAN a few days ago, and did my part to decrease the load on the gentoo mirrors.

I'd like to point out one discrepancy that I've noticed between the guide and the current location of rsyncd.conf on my computers. It seems that the default location of the rscyncd.conf files on my Gentoo boxes is different from the location suggested by the guide:

The guide states that the configuration files are located at /etc/rsync/rsyncd.conf. On both my 2004.3 and 2005.0 boxes there is no /etc/rsync directory, and the rsyncd.conf file is located at /etc/rsyncd.conf. After taking that discrepancy into account, the process of creating an rsync server works fine with the guide as it is written.

My RSYNC server has been running fine for a few days now. I've decided to rebuild the Gentoo installation on the PC that I was using as the rsync client because of a separate software project I'm working on. The rsync client seemed to have worked for a brief period, but now appears broken and issues the following error message:

then rsync reiterates for the specified number of attempts, and issues this error:

Code:

!!! Rsync has not successfully finished. It is recommended that you keep
!!! trying or that you use the 'emerge-webrsync' option if you are unable
!!! to use rsync due to firewall or other restrictions. This should be a
!!! temporary problem unless complications exist with your network
!!! (and possibly your system's filesystem) configuration.

what seems most odd about this situation was that i have not made any changes to the rsync server. the only thing that i had changed was to reinstall gentoo on a client box upon which rsync had worked fine before.

it seems that i have the rsync settings properly configured in make.conf on the client PC:

so i am at a loss to explain why the rsync appears to be broken. i had considered that i may have encountered a timeout problem, because the client box is slow. so i've increased the timeout values on both the client and the server to a generous 600 seconds. unfortunately, that hasn't improved the situation.

then rsync reiterates for the specified number of attempts, and issues this error:

Code:

!!! Rsync has not successfully finished. It is recommended that you keep
!!! trying or that you use the 'emerge-webrsync' option if you are unable
!!! to use rsync due to firewall or other restrictions. This should be a
!!! temporary problem unless complications exist with your network
!!! (and possibly your system's filesystem) configuration.

what seems most odd about this situation was that i have not made any changes to the rsync server. the only thing that i had changed was to reinstall gentoo on a client box upon which rsync had worked fine before.

it seems that i have the rsync settings properly configured in make.conf on the client PC:

that seems more a server side problem who has certainly disconnected since .
Have you increased your --timeout option to 300 or more ?
Look after the /etc/conf.d/rsyncd file or /etc/xinet.d/ directory if your are using xinetd and try to modify the --timeout for a more appropriate value.

that seems more a server side problem who has certainly disconnected since .
Have you increased your --timeout option to 300 or more ?
Look after the /etc/conf.d/rsyncd file or /etc/xinet.d/ directory if your are using xinetd and try to modify the --timeout for a more appropriate value.

Jj

yes, i thought i had mentioned that i've tried increasing the server and client timeouts to a generous value of 600.

what is really strange is that the server works fine with the other boxes on the network that are rsyncing. one client box (2005.0) is having problems. i've rebuilt rsync on the server and the effected client with no change in results. i'm still trying to figure out what the error messages mean. _________________.
Stage 1/3 | Jackass! | Rockhopper! | Thanks | Google Sucks

yes, i thought i had mentioned that i've tried increasing the server and client timeouts to a generous value of 600.

Sorry i was absent-minded and i thought you were using xinetd and in that case rsyncd.conf isn't used at all. You need to add it manually for the service.
The strange thing is that rsync caught an INT signal.
Could you trace the process with strace ?

well, i've solved the problem. it turns out that there was a corrupted baselayout ebuild in the portage tree. i'm not absolutely certain that this was the problem, as i used the shotgun approach of updating the ebuild while rebuilding the entire installation with the --emptytree command. baselayout was the only ebuild that changed, and the net result is that the "rsync over LAN" problem magically disappeared. it seems that the problem was indeed on the client and not the server. thanks for your help.

one thing that i would point out that may be worth updating in the guide: the location of /etc/rsync/rsyncd.conf is now /etc/rsyncd.conf.

#!/sbin/runscript
# Copyright 1999-2002 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License, v2
or later
# $Header: /var/www/www.gentoo.org/raw_cvs/gentoo/xml/htdocs/doc/en/rsync.xml,v$

I just tried it today and it fixed the io.c problem...
So I guess people should try a reboot on the client and perhaps re-running emerge sync on the server (my server does this automatically at night)
HTH
bino

I just tried it today and it fixed the io.c problem...
So I guess people should try a reboot on the client and perhaps re-running emerge sync on the server (my server does this automatically at night)
HTH
bino