How to setup a Gentoo Linux Portage Tree rsync daemon on slackware

How to setup a Gentoo Linux Portage Tree rsync daemon on slackware

First you install rsync by using swaret:
swaret –install rsync

Then we have to create a directory to store the portage mirror in, here we use: /mnt/cache/rsync/portage
After creating the directory we need to create a few scripts and config files.

Create the directory /etc/rsync and create these two files:

/etc/rsync/rsyncd.motd :
————————————— File start
Type your welcome message here, it will be displayed when people sync with your mirror.
————————————— File end

/etc/rsync/rsyncd.conf :
————————————— File start
uid = nobody
gid = nobody
use chroot = yes
max connections = 10
pid file = /var/run/rsyncd.pid
motd file = /etc/rsync/rsyncd.motd

[gentoo-portage]
path = /mnt/cache/rsync/portage
comment = Gentoo Linux Portage tree mirror
exclude = distfiles
————————————— File end

Change path if you are going to use another directory.

/etc/rc.d/rc.rsyncd :
————————————— File start
#!/bin/sh
/usr/bin/rsync –daemon –config=/etc/rsync/rsyncd.conf
————————————— File end

chmod +x the script, and add it to /etc/rc.d/rc.M
Then create this script to make it sync the tree against the master servers once a day:

/etc/cron.daily/irsyncd :
————————————— File start
#!/bin/sh
/usr/bin/rsync –recursive –links –safe-links –perms –times \
–compress –force –whole-file –delete –delete-after \
–stats –timeout=180 –exclude=distfiles/* –exclude=local/* \
–exclude=packages/* –progress rsync://rsync.gentoo.org/gentoo-portage/* \
/mnt/cache/rsync/portage
————————————— File end

chmod +x the script, and run it to do an initial sync to so you do not have till midnight.

If you are using a firewall on the server, you have to open port 873 TCP .

Dette indlæg blev udgivet i Knowledge Base, Linux, Old Base. Bogmærk permalinket.

Skriv et svar