Rewrite the config chapter to be more clear and use professional language.

PR:		docs/164920
Submitted by:	Niclas Zeising <zeising@daemonic.se>
Reviewed by:	gjb (older version)
Approved by:	bcr
This commit is contained in:
Eitan Adler 2012-03-26 16:42:26 +00:00
parent 40a61b036c
commit bb233c6217
Notes: svn2git 2020-12-08 03:00:23 +00:00
svn path=/head/; revision=38624

View file

@ -473,13 +473,14 @@ run_rc_command "$1"</programlisting>
certain times.</para> certain times.</para>
<para>The <command>cron</command> utility uses two different <para>The <command>cron</command> utility uses two different
types of configuration files, the system crontab and user crontabs. The types of configuration files, the system crontab and user
only difference between these two formats is the sixth field. In the crontabs. These formats only differ in the sixth field and
system crontab, the sixth field is the name of a user for the command later. In the system crontab, <command>cron</command> will run
to run as. This gives the system crontab the ability to run commands the command as the user specified in the sixth field. In a user
as any user. In a user crontab, the sixth field is the command to run, crontab, all commands run as the user who created the crontab,
and all commands run as the user who created the crontab; this is an so the sixth field is the last field; this is an important
important security feature.</para> security feature. The final field is always the command
to run.</para>
<note> <note>
<para>User crontabs allow individual users to schedule tasks without the <para>User crontabs allow individual users to schedule tasks without the
@ -487,10 +488,11 @@ run_rc_command "$1"</programlisting>
permissions of the user who owns the crontab.</para> permissions of the user who owns the crontab.</para>
<para>The <username>root</username> user can have a user crontab just like <para>The <username>root</username> user can have a user crontab just like
any other user. This one is different from any other user. The <username>root</username> user crontab is
<filename>/etc/crontab</filename> (the system crontab). Because of the separate from <filename>/etc/crontab</filename> (the system
system crontab, there is usually no need to create a user crontab crontab). Because the system crontab effectively
for <username>root</username>.</para> invokes the specified commands as root there is usually no need to
create a user crontab for <username>root</username>.</para>
</note> </note>
<para>Let us take a look at the <filename>/etc/crontab</filename> file <para>Let us take a look at the <filename>/etc/crontab</filename> file
@ -547,11 +549,8 @@ HOME=/var/log
day of the week. All these fields must be numeric values, and follow day of the week. All these fields must be numeric values, and follow
the twenty-four hour clock. The <literal>who</literal> field is special, the twenty-four hour clock. The <literal>who</literal> field is special,
and only exists in the <filename>/etc/crontab</filename> file. and only exists in the <filename>/etc/crontab</filename> file.
This field specifies which user the command should be run as. This field specifies which user the command should be run
When a user installs his or her <filename>crontab</filename> file, they as. The last field is the command to be executed.</para>
will not have this option. Finally, the <literal>command</literal> option is listed.
This is the last field, so naturally it should designate the command
to be executed.</para>
</callout> </callout>
<callout arearefs="co-main"> <callout arearefs="co-main">
@ -584,8 +583,9 @@ HOME=/var/log
<title>Installing a Crontab</title> <title>Installing a Crontab</title>
<important> <important>
<para>You must not use the procedure described here to <para>Do not use the procedure described here to
edit/install the system crontab. Simply use your favorite edit and install the system crontab,
<filename>/etc/crontab</filename>. Just use your favorite
editor: the <command>cron</command> utility will notice that the file editor: the <command>cron</command> utility will notice that the file
has changed and immediately begin using the updated version. has changed and immediately begin using the updated version.
See See
@ -2390,15 +2390,39 @@ kern.maxvnodes: 100000</screen>
<xref linkend="swap-encrypting"> of the Handbook.</para> <xref linkend="swap-encrypting"> of the Handbook.</para>
<sect2 id="new-drive-swap"> <sect2 id="new-drive-swap">
<title>Swap on a New Hard Drive</title> <title>Swap on a New or Existing Hard Drive</title>
<para>The best way to add swap, of course, is to use this as an <para>Adding a new hard drive for swap gives better performance
excuse to add another hard drive. You can always use another than adding a partition on an existing drive. Setting up
hard drive, after all. If you can do this, go reread the partitions and hard drives is explained in
discussion of swap space <xref linkend="disks-adding">.
in <xref linkend="configtuning-initial"> <xref linkend="configtuning-initial">
of the Handbook for some suggestions on how to best discusses partition layouts and swap partition size
arrange your swap.</para> considerations.</para>
<para>Use &man.swapon.8; to add a swap partition to the system.
For example:</para>
<screen>&prompt.root; <userinput>swapon<replaceable> /dev/ada1s1p2</replaceable></userinput></screen>
<warning>
<para>It is possible to use any partition not currently
mounted, even if it already contains data. Using
&man.swapon.8; on a partition that contains data will
overwrite and destroy that data. Make sure that the
partition to be added as swap is really the intended
partition before running
&man.swapon.8;.</para>
</warning>
<para>To automatically add this swap partition on boot,
add an entry to <filename>/etc/fstab</filename> for the
partition:</para>
<programlisting><replaceable>/dev/ada1s1p1</replaceable> none swap sw 0 0</programlisting>
<para>See &man.fstab.5; for an explaination of the entries
in <filename>/etc/fstab</filename>.</para>
</sect2> </sect2>
<sect2 id="nfs-swap"> <sect2 id="nfs-swap">