«前の日記(2009-05-02) 最新 次の日記(2009-05-12)» 編集

meta's blog - The Power To Serve

筆者について

FreeBSDを通じてOSSにささかな貢献を。

OSS活動をご支援いただける方を募集しています


2009-05-07 FreeBSD 7.2-RELEASE Available

cvsup-mirror でミラーサーバの構築

FreeBSD 7.2-RELEASE 出ました。リリース直後は freebsd-update サーバも cvsup サーバも混み合ってアップデートできない状態でした。

研究室や自宅やその他で FreeBSD マシンが増えてきたので、ローカルに1台 cvsup のミラーを構築してみました。

# cd /usr/ports/net/cvsup-mirror
# make
===>  Vulnerability check disabled, database not found
===>  Extracting for cvsup-mirror-1.3_8
===>  Patching for cvsup-mirror-1.3_8
===>  Configuring for cvsup-mirror-1.3_8
I am going to ask you a few questions so that I can set up your
FreeBSD mirror configuration.  Every question has a [default]
answer.  To accept the default, just press ENTER.

At this point, I am just gathering information.  I will not touch
your system until you type "make install".

Master site for your updates [cvsup-master.freebsd.org]? cvsup2.jp.freebsd.org

How many hours between updates of your files [1]?

Now you must decide which sets of files you wish to make available
from your mirror site.  You can choose any combination, and you
can put each set anywhere you want to on your disks.  Although each
set is optional, we strongly encourage every mirror site to carry
at least the main source repository.

Do you wish to mirror the main source repository [y]?
Where would you like to put it [/home/ncvs]?
Do you wish to mirror the installed World Wide Web data [y]? n
Do you wish to mirror the GNATS bug tracking database [y]? n
Do you wish to mirror the mailing list archive [y]? n

Now, a few questions so that I can set up your CVSup server properly.

For security reasons, both the CVSup client and server should run
under their own unique user and group IDs.  These IDs should have no
special access privileges.  Normally, the user:group "cvsupin:cvsupin"
is used for the client and "cvsup:cvsup" is used for the server, but
you can choose other names if you wish.  At "make install" time, I
will create the users and groups, if they don't already exist.

Use unique user and group IDs for these.  Do not use "nobody",
"nonroot", or "nogroup".

Unique unprivileged user ID for running the client [cvsupin]?
Unique unprivileged group ID for running the client [cvsupin]?
Unique unprivileged user ID for running the server [cvsup]?
Unique unprivileged group ID for running the server [cvsup]?

The CVSup server does its logging via syslog.  At "make install"
time, I will set up the logging for you, if necessary.  I will use
the "!program" feature of syslog to keep your CVSup log messages
separate from the messages of your other daemons.

Syslog facility for the server log [daemon]?

You can control the load on your machine by limiting the number of
clients that the CVSup server will serve at once.  CVSup won't load
your network especially heavily, but it is more CPU and disk
intensive than most other file server software.

Maximum simultaneous client connections [8]?

Building the "config.sh" file ... Done.
Building the "cvsupd.access" file ... Done.
# make install

あとは /etc/rc.conf に

cvsupd_enable="YES"

とでも書いておきます。しばらく放っておくと cron で手元にミラーが構築されるので、

# /usr/local/etc/rc.d/cvsupd start

を実行して cvsupd を起動しておけばOKです。

cron で同期してくれるのを待つのではなく、すぐに同期を実行したい場合は

# /usr/local/etc/cvsup/update.sh

を実行します。シェルスクリプトの中を見るとわかりますが、フルパスで実行しないと動かないので注意が必要です。

これで構築したミラーサーバが cvsup.freebsd.vmeta.jp です。利用はご自由に。利用の際は supfile で compress を無効にするか、cvsup (csup) に -Z (大文字) オプションを付けて圧縮を無効にしてください。