Remove current portsnap chapter, it's a bit aged and replaced by the
version in the Updating chapter. Discussed with: cperciva
This commit is contained in:
parent
02c59cb128
commit
c3411beb86
Notes:
svn2git
2020-12-08 03:00:23 +00:00
svn path=/head/; revision=32972
2 changed files with 1 additions and 177 deletions
en_US.ISO8859-1/books/handbook
|
@ -2373,182 +2373,6 @@ doc/zh_*</screen>
|
|||
</sect2>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="portsnap">
|
||||
<title>Using Portsnap</title>
|
||||
|
||||
<sect2 id="portsnap-intro">
|
||||
<title>Introduction</title>
|
||||
|
||||
<para><application>Portsnap</application> is a system for securely
|
||||
distributing the &os; ports tree. Approximately once an hour,
|
||||
a <quote>snapshot</quote> of the ports tree is generated,
|
||||
repackaged, and cryptographically signed. The resulting files
|
||||
are then distributed via HTTP.</para>
|
||||
|
||||
<para>Like <application>CVSup</application>,
|
||||
<application>Portsnap</application> uses a
|
||||
<emphasis>pull</emphasis> model of updating: The packaged and
|
||||
signed ports trees are placed on a web server which waits
|
||||
passively for clients to request files. Users must either run
|
||||
&man.portsnap.8; manually to download updates
|
||||
or set up a &man.cron.8; job to download updates
|
||||
automatically on a regular basis.</para>
|
||||
|
||||
<para>For technical reasons, <application>Portsnap</application>
|
||||
does not update the <quote>live</quote> ports tree in
|
||||
<filename>/usr/ports/</filename> directly; instead, it works
|
||||
via a compressed copy of the ports tree stored in
|
||||
<filename>/var/db/portsnap/</filename> by default. This
|
||||
compressed copy is then used to update the live ports tree.</para>
|
||||
|
||||
<note>
|
||||
<para>If <application>Portsnap</application> is installed from
|
||||
the &os; Ports Collection, then the default location for its
|
||||
compressed snapshot will be <filename>/usr/local/portsnap/</filename>
|
||||
instead of <filename>/var/db/portsnap/</filename>.</para>
|
||||
</note>
|
||||
</sect2>
|
||||
|
||||
<sect2 id="portsnap-install">
|
||||
<title>Installation</title>
|
||||
|
||||
<para>On &os; 6.0 and more recent versions,
|
||||
<application>Portsnap</application> is contained in the &os;
|
||||
base system. On older versions of &os;, it can be installed
|
||||
using the <filename role="package">ports-mgmt/portsnap</filename>
|
||||
port.</para>
|
||||
</sect2>
|
||||
|
||||
<sect2 id="portsnap-config">
|
||||
<title>Portsnap Configuration</title>
|
||||
|
||||
<para><application>Portsnap</application>'s operation is controlled
|
||||
by the <filename>/etc/portsnap.conf</filename> configuration
|
||||
file. For most users, the default configuration file will
|
||||
suffice; for more details, consult the &man.portsnap.conf.5;
|
||||
manual page.</para>
|
||||
|
||||
<note>
|
||||
<para>If <application>Portsnap</application> is installed from
|
||||
the &os; Ports Collection, it will use the configuration file
|
||||
<filename>/usr/local/etc/portsnap.conf</filename> instead of
|
||||
<filename>/etc/portsnap.conf</filename>. This configuration
|
||||
file is not created when the port is installed, but a sample
|
||||
configuration file is distributed; to copy it into place, run
|
||||
the following command:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>cd /usr/local/etc && cp portsnap.conf.sample portsnap.conf</userinput></screen>
|
||||
</note>
|
||||
</sect2>
|
||||
|
||||
<sect2>
|
||||
<title>Running <application>Portsnap</application> for the First
|
||||
Time</title>
|
||||
|
||||
<para>The first time &man.portsnap.8; is run,
|
||||
it will need to download a compressed snapshot of the entire
|
||||
ports tree into <filename>/var/db/portsnap/</filename> (or
|
||||
<filename>/usr/local/portsnap/</filename> if
|
||||
<application>Portsnap</application> was installed from the
|
||||
Ports Collection). For the beginning of 2006 this is approximately a 41 MB
|
||||
download.</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>portsnap fetch</userinput></screen>
|
||||
|
||||
<para>Once the compressed snapshot has been downloaded, a
|
||||
<quote>live</quote> copy of the ports tree can be extracted into
|
||||
<filename>/usr/ports/</filename>. This is necessary even if a
|
||||
ports tree has already been created in that directory (e.g., by
|
||||
using <application>CVSup</application>), since it establishes a
|
||||
baseline from which <command>portsnap</command> can
|
||||
determine which parts of the ports tree need to be updated
|
||||
later.</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>portsnap extract</userinput></screen>
|
||||
|
||||
<note>
|
||||
<para>In the default installation
|
||||
<filename class="directory">/usr/ports</filename> is not
|
||||
created. If you run &os; 6.0-RELEASE, it should be created before
|
||||
<command>portsnap</command> is used. On more recent
|
||||
versions of &os; or <application>Portsnap</application>,
|
||||
this operation will be done automatically at first use
|
||||
of the <command>portsnap</command> command.<para>
|
||||
</note>
|
||||
</sect2>
|
||||
|
||||
<sect2>
|
||||
<title>Updating the Ports Tree</title>
|
||||
|
||||
<para>After an initial compressed snapshot of the ports tree has
|
||||
been downloaded and extracted into <filename>/usr/ports/</filename>,
|
||||
updating the ports tree consists of two steps:
|
||||
<emphasis>fetch</emphasis>ing updates to the compressed
|
||||
snapshot, and using them to <emphasis>update</emphasis> the
|
||||
live ports tree. These two steps can be specified to
|
||||
<command>portsnap</command> as a single command:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>portsnap fetch update</userinput></screen>
|
||||
|
||||
<note>
|
||||
<para>Some older versions of <command>portsnap</command>
|
||||
do not support this syntax; if it fails, try instead the
|
||||
following:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>portsnap fetch</userinput>
|
||||
&prompt.root; <userinput>portsnap update</userinput></screen>
|
||||
</note>
|
||||
</sect2>
|
||||
|
||||
<sect2>
|
||||
<title>Running Portsnap from cron</title>
|
||||
|
||||
<para>In order to avoid problems with <quote>flash crowds</quote>
|
||||
accessing the <application>Portsnap</application> servers,
|
||||
<command>portsnap fetch</command> will not run from
|
||||
a &man.cron.8; job. Instead, a special
|
||||
<command>portsnap cron</command> command exists, which
|
||||
waits for a random duration up to 3600 seconds before fetching
|
||||
updates.</para>
|
||||
|
||||
<para>In addition, it is strongly recommended that
|
||||
<command>portsnap update</command> not be run from a
|
||||
<command>cron</command> job, since it is liable to cause
|
||||
major problems if it happens to run at the same time as a port
|
||||
is being built or installed. However, it is safe to update
|
||||
the ports' <filename>INDEX</filename> files, and this can be done by passing the
|
||||
<option>-I</option> flag to
|
||||
<command>portsnap</command>. (Obviously, if
|
||||
<command>portsnap -I update</command> is run from
|
||||
<command>cron</command>, then it will be necessary to run
|
||||
<command>portsnap update</command> without the <option>-I</option>
|
||||
flag at a later time in order to update the rest of the tree.)</para>
|
||||
|
||||
<para>Adding the following line to <filename>/etc/crontab</filename>
|
||||
will cause <command>portsnap</command> to update its
|
||||
compressed snapshot and the <filename>INDEX</filename> files in
|
||||
<filename>/usr/ports/</filename>, and will send an email if any
|
||||
installed ports are out of date:</para>
|
||||
|
||||
<programlisting>0 3 * * * root portsnap -I cron update && pkg_version -vIL=</programlisting>
|
||||
|
||||
<note>
|
||||
<para>If the system clock is not set to the local time zone,
|
||||
please replace <literal>3</literal> with a random
|
||||
value between 0 and 23, in order to spread the load on the
|
||||
<application>Portsnap</application> servers more evenly.</para>
|
||||
</note>
|
||||
<note>
|
||||
<para>Some older versions of <command>portsnap</command>
|
||||
do not support listing multiple commands (e.g., <literal>cron update</literal>)
|
||||
in the same invocation of <command>portsnap</command>. If
|
||||
the line above fails, try replacing
|
||||
<command>portsnap -I cron update</command> with
|
||||
<command>portsnap cron && portsnap -I update</command>.</para>
|
||||
</note>
|
||||
</sect2>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="cvs-tags">
|
||||
<title>CVS Tags</title>
|
||||
|
||||
|
|
|
@ -708,7 +708,7 @@ docbook =
|
|||
|
||||
<screen>&prompt.root; <userinput>pkg_add -r portsnap</userinput></screen>
|
||||
|
||||
<para>Please refer to <link linkend="portsnap">Using Portsnap</link>
|
||||
<para>Please refer to <link linkend="updating-portsnap">Using Portsnap</link>
|
||||
for a detailed description of all <application>Portsnap</application>
|
||||
features.</para>
|
||||
|
||||
|
|
Loading…
Reference in a new issue