From owner-p4-projects@FreeBSD.ORG Wed Apr 18 08:26:17 2012 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id E747A1065673; Wed, 18 Apr 2012 08:26:16 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9F898106566C for ; Wed, 18 Apr 2012 08:26:16 +0000 (UTC) (envelope-from rene@FreeBSD.org) Received: from skunkworks.freebsd.org (skunkworks.freebsd.org [IPv6:2001:4f8:fff6::2d]) by mx1.freebsd.org (Postfix) with ESMTP id 86CA28FC08 for ; Wed, 18 Apr 2012 08:26:16 +0000 (UTC) Received: from skunkworks.freebsd.org (localhost [127.0.0.1]) by skunkworks.freebsd.org (8.14.4/8.14.4) with ESMTP id q3I8QGvD098035 for ; Wed, 18 Apr 2012 08:26:16 GMT (envelope-from rene@FreeBSD.org) Received: (from perforce@localhost) by skunkworks.freebsd.org (8.14.4/8.14.4/Submit) id q3I8QF9i098032 for perforce@freebsd.org; Wed, 18 Apr 2012 08:26:15 GMT (envelope-from rene@FreeBSD.org) Date: Wed, 18 Apr 2012 08:26:15 GMT Message-Id: <201204180826.q3I8QF9i098032@skunkworks.freebsd.org> X-Authentication-Warning: skunkworks.freebsd.org: perforce set sender to rene@FreeBSD.org using -f From: Rene Ladan To: Perforce Change Reviews Precedence: bulk Cc: Subject: PERFORCE change 209765 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Apr 2012 08:26:17 -0000 http://p4web.freebsd.org/@@209765?ac=10 Change 209765 by rene@rene_acer on 2012/04/18 08:26:11 IFC Affected files ... .. //depot/projects/docproj_nl/en_US.ISO8859-1/articles/contributors/contrib.additional.sgml#136 integrate .. //depot/projects/docproj_nl/en_US.ISO8859-1/articles/contributors/contrib.committers.sgml#81 integrate .. //depot/projects/docproj_nl/en_US.ISO8859-1/articles/nanobsd/article.sgml#6 integrate .. //depot/projects/docproj_nl/en_US.ISO8859-1/books/faq/book.sgml#44 integrate .. //depot/projects/docproj_nl/en_US.ISO8859-1/books/handbook/config/chapter.sgml#22 integrate .. //depot/projects/docproj_nl/en_US.ISO8859-1/books/handbook/introduction/chapter.sgml#23 integrate .. //depot/projects/docproj_nl/en_US.ISO8859-1/books/porters-handbook/book.sgml#137 integrate .. //depot/projects/docproj_nl/en_US.ISO8859-1/share/sgml/authors.ent#74 integrate .. //depot/projects/docproj_nl/nl_NL.ISO8859-1/books/handbook/boot/chapter.sgml#18 integrate .. //depot/projects/docproj_nl/nl_NL.ISO8859-1/books/handbook/desktop/chapter.sgml#62 integrate .. //depot/projects/docproj_nl/www/en/advocacy/index.sgml#4 integrate .. //depot/projects/docproj_nl/www/en/developers.sgml#74 integrate .. //depot/projects/docproj_nl/www/en/support/bugreports.sgml#2 integrate .. //depot/projects/docproj_nl/www/share/sgml/news.xml#139 integrate Differences ... ==== //depot/projects/docproj_nl/en_US.ISO8859-1/articles/contributors/contrib.additional.sgml#136 (text+ko) ==== @@ -1,4 +1,4 @@ - + + - Chern + Chern Lee Written by - Mike + Mike Smith Based on a tutorial written by - Matt + Matt Dillon Also based on tuning(7) written by @@ -37,12 +37,11 @@ system configuration system optimization - One of the important aspects of &os; is system configuration. - Correct system configuration will help prevent headaches during future upgrades. - This chapter will explain much of the &os; configuration process, - including some of the parameters which - can be set to tune a &os; system. - + One of the important aspects of &os; is system + configuration. Correct system configuration will help prevent + headaches during future upgrades. This chapter will explain + much of the &os; configuration process, including some of the + parameters which can be set to tune a &os; system. After reading this chapter, you will know: @@ -51,24 +50,33 @@ How to efficiently work with file systems and swap partitions. + - The basics of rc.conf configuration and - /usr/local/etc/rc.d startup systems. + The basics of rc.conf configuration + and /usr/local/etc/rc.d startup + systems. + How to configure and test a network card. + - How to configure virtual hosts on your network devices. + How to configure virtual hosts on your network + devices. + How to use the various configuration files in /etc. + - How to tune &os; using sysctl - variables. + How to tune &os; using sysctl + variables. + How to tune disk performance and modify kernel limitations. @@ -82,8 +90,10 @@ Understand &unix; and &os; basics (). + - Be familiar with the basics of kernel configuration/compilation + Be familiar with the basics of kernel + configuration/compilation (). @@ -97,66 +107,75 @@ partition layout - /etc + /etc - /var + /var - /usr + /usr Base Partitions - When laying out file systems with &man.bsdlabel.8; - or &man.sysinstall.8;, remember that hard - drives transfer data faster from the outer - tracks to the inner. - Thus smaller and heavier-accessed file systems - should be closer to the outside of the drive, while - larger partitions like /usr should be placed - toward the inner parts of the disk. It is a good idea to create - partitions in an order similar to: root, swap, - /var, /usr. + When laying out file systems with &man.bsdlabel.8; or + &man.sysinstall.8;, remember that hard drives transfer data + faster from the outer tracks to the inner. Thus smaller and + heavier-accessed file systems should be closer to the + outside of the drive, while larger partitions like + /usr should be placed + toward the inner parts of the disk. It is a good idea to + create partitions in an order similar to: root, swap, + /var, + /usr. - The size of the /var partition - reflects the intended machine usage. - The /var file system is used to hold - mailboxes, log files, and printer spools. Mailboxes and log - files can grow to unexpected sizes depending - on how many users exist and how long log - files are kept. Most users will rarely need more than about a - gigabyte of free disk space in /var. + The size of the + /var partition + reflects the intended machine usage. The + /var file system is + used to hold mailboxes, log files, and printer spools. + Mailboxes and log files can grow to unexpected sizes + depending on how many users exist and how long log files are + kept. Most users will rarely need more than about a + gigabyte of free disk space in + /var. - There are a few times that a lot of disk space is required - in /var/tmp. When new software is installed - with &man.pkg.add.1; the packaging tools extract a temporary copy - of the packages under /var/tmp. Large - software packages, like Firefox, - OpenOffice or LibreOffice - may be tricky to install if there is not enough disk space under + There are a few times that a lot of disk space is + required in + /var/tmp. When new + software is installed with &man.pkg.add.1; the packaging + tools extract a temporary copy of the packages under + /var/tmp. Large + software packages, like + Firefox, + OpenOffice or + LibreOffice may be tricky to + install if there is not enough disk space under /var/tmp. - The /usr partition holds many - of the files required to support the system, including the &man.ports.7; - collection (recommended) and the source code (optional). Both the - ports and the sources of the base system are optional at install - time, but we recommend at least 2 gigabytes for this - partition. + The /usr + partition holds many of the files required to support the + system, including the &man.ports.7; collection (recommended) + and the source code (optional). Both the ports and the + sources of the base system are optional at install time, but + we recommend at least 2 gigabytes for this partition. When selecting partition sizes, keep the space requirements in mind. Running out of space in one partition while barely using another can be a hassle. - Some users have found that &man.sysinstall.8;'s + + Some users have found that &man.sysinstall.8;'s Auto-defaults partition sizer will - sometimes select smaller than adequate /var - and / partitions. Partition wisely and - generously. + sometimes select smaller than adequate + /var and + / partitions. + Partition wisely and generously. + @@ -165,64 +184,60 @@ swap sizing swap partition - As a rule of thumb, the swap partition should be - about double the size of system memory (RAM). For example, - if the machine has 128 megabytes of memory, - the swap file should be 256 megabytes. Systems with - less memory may perform better with more swap. - Less than 256 megabytes of swap is not recommended and - memory expansion should be considered. - The kernel's VM paging algorithms are tuned to - perform best when the swap partition is at least two times the - size of main memory. Configuring too little swap can lead to - inefficiencies in the VM page scanning code and might create - issues later if more memory is added. + As a rule of thumb, the swap partition should be about + double the size of system memory (RAM). For example, if the + machine has 128 megabytes of memory, the swap file + should be 256 megabytes. Systems with less memory may + perform better with more swap. Less than 256 megabytes + of swap is not recommended and memory expansion should be + considered. The kernel's VM paging algorithms are tuned to + perform best when the swap partition is at least two times + the size of main memory. Configuring too little swap can + lead to inefficiencies in the VM page scanning code and + might create issues later if more memory is added. - On larger systems with multiple SCSI disks (or - multiple IDE disks operating on different controllers), it is - recommend that a swap is configured on each drive (up - to four drives). The swap partitions should be - approximately the same size. The kernel can handle arbitrary - sizes but internal data structures scale to 4 times the - largest swap partition. Keeping the swap partitions near the - same size will allow the kernel to optimally stripe swap space - across disks. - Large swap sizes are fine, even if swap is not - used much. It might be easier to recover - from a runaway program before being forced to reboot. + On larger systems with multiple SCSI disks (or multiple + IDE disks operating on different controllers), it is + recommend that a swap is configured on each drive (up to + four drives). The swap partitions should be approximately + the same size. The kernel can handle arbitrary sizes but + internal data structures scale to 4 times the largest swap + partition. Keeping the swap partitions near the same size + will allow the kernel to optimally stripe swap space across + disks. Large swap sizes are fine, even if swap is not used + much. It might be easier to recover from a runaway program + before being forced to reboot. Why Partition? - Several users think a single large partition will be fine, - but there are several reasons why this is a bad idea. + Several users think a single large partition will be + fine, but there are several reasons why this is a bad idea. First, each partition has different operational - characteristics and separating them allows the file system to - tune accordingly. For example, the root - and /usr partitions are read-mostly, without - much writing. While a lot of reading and writing could - occur in /var and + characteristics and separating them allows the file system + to tune accordingly. For example, the root and + /usr partitions are + read-mostly, without much writing. While a lot of reading + and writing could occur in + /var and /var/tmp. By properly partitioning a system, fragmentation - introduced in the smaller write heavy partitions - will not bleed over into the mostly-read partitions. - Keeping the write-loaded partitions closer to - the disk's edge, - will + introduced in the smaller write heavy partitions will not + bleed over into the mostly-read partitions. Keeping the + write-loaded partitions closer to the disk's edge, will increase I/O performance in the partitions where it occurs - the most. Now while I/O - performance in the larger partitions may be needed, - shifting them more toward the edge of the disk will not - lead to a significant performance improvement over moving + the most. Now while I/O performance in the larger + partitions may be needed, shifting them more toward the edge + of the disk will not lead to a significant performance + improvement over moving /var to the edge. Finally, there are safety concerns. A smaller, neater root - partition which is mostly read-only has a greater - chance of surviving a bad crash. + partition which is mostly read-only has a greater chance of + surviving a bad crash. - @@ -234,20 +249,20 @@ The principal location for system configuration information - is within /etc/rc.conf. This file - contains a wide range of configuration information, principally - used at system startup to configure the system. Its name - directly implies this; it is configuration information for the + is within /etc/rc.conf. This file contains + a wide range of configuration information, principally used at + system startup to configure the system. Its name directly + implies this; it is configuration information for the rc* files. An administrator should make entries in the - rc.conf file to - override the default settings from - /etc/defaults/rc.conf. The defaults file - should not be copied verbatim to /etc - it - contains default values, not examples. All system-specific - changes should be made in the rc.conf - file itself. + rc.conf file to override the default + settings from /etc/defaults/rc.conf. The + defaults file should not be copied verbatim to + /etc - it contains + default values, not examples. All system-specific changes + should be made in the rc.conf file + itself. A number of strategies may be applied in clustered applications to separate site-wide configuration from @@ -258,27 +273,33 @@ example: - /etc/rc.conf: + + /etc/rc.conf: - sshd_enable="YES" + sshd_enable="YES" keyrate="fast" -defaultrouter="10.1.1.254" +defaultrouter="10.1.1.254" + + + + + /etc/rc.conf.local: - /etc/rc.conf.local: + hostname="node1.example.org" +ifconfig_fxp0="inet 10.1.1.1/8" -hostname="node1.example.org" -ifconfig_fxp0="inet 10.1.1.1/8" + The rc.conf file can then be distributed to every system using rsync or a - similar program, while the rc.conf.local file - remains unique. + similar program, while the rc.conf.local + file remains unique. - Upgrading the system using &man.sysinstall.8; - or make world will not overwrite the - rc.conf - file, so system configuration information will not be lost. + Upgrading the system using &man.sysinstall.8; or + make world will not overwrite the + rc.conf file, so system configuration + information will not be lost. The /etc/rc.conf configuration file @@ -301,21 +322,22 @@ /usr/local/etc Typically, these files are installed in - /usr/local/etc. In the case where an - application has a large number of configuration files, a - subdirectory will be created to hold them. + /usr/local/etc. In the + case where an application has a large number of configuration + files, a subdirectory will be created to hold them. Normally, when a port or package is installed, sample configuration files are also installed. These are usually - identified with a .default suffix. If there - are no existing - configuration files for the application, they will be created by - copying the .default files. + identified with a .default suffix. If + there are no existing configuration files for the application, + they will be created by copying the + .default files. For example, consider the contents of the directory - /usr/local/etc/apache: + /usr/local/etc/apache: --rw-r--r-- 1 root wheel 2184 May 20 1998 access.conf + -rw-r--r-- 1 root wheel 2184 May 20 1998 access.conf -rw-r--r-- 1 root wheel 2184 May 20 1998 access.conf.default -rw-r--r-- 1 root wheel 9555 May 20 1998 httpd.conf -rw-r--r-- 1 root wheel 9555 May 20 1998 httpd.conf.default @@ -326,19 +348,19 @@ -rw-r--r-- 1 root wheel 7980 May 20 1998 srm.conf -rw-r--r-- 1 root wheel 7933 May 20 1998 srm.conf.default - The file sizes show that only the srm.conf - file has been changed. A later update of the Apache port would not + The file sizes show that only the + srm.conf file has been changed. A later + update of the Apache port would not overwrite this changed file. - - - Tom - Rhodes - Contributed by + + Tom + Rhodes + Contributed by @@ -348,27 +370,28 @@ services Many users choose to install third party software on &os; - from the Ports Collection. In many of these situations it - may be necessary to configure the software in a manner which - will allow it to be started upon system initialization. Services, + from the Ports Collection. In many of these situations it may + be necessary to configure the software in a manner which will + allow it to be started upon system initialization. Services, such as mail/postfix or - www/apache22 are just two - of the many software packages which may be started during system + www/apache22 are just two of + the many software packages which may be started during system initialization. This section explains the procedures available for starting third party software. In &os;, most included services, such as &man.cron.8;, are started through the system start up scripts. These scripts may differ depending on &os; or vendor version; however, the most - important aspect to consider is that their start up configuration - can be handled through simple startup scripts. + important aspect to consider is that their start up + configuration can be handled through simple startup + scripts. Extended Application Configuration - Now that &os; includes rc.d, configuration - of application startup has become easier, and more - featureful. Using the key words discussed in the + Now that &os; includes rc.d, + configuration of application startup has become easier, and + more featureful. Using the key words discussed in the rc.d section, applications may now be set to start after certain other services for example DNS; may permit extra @@ -402,9 +425,9 @@ This script will ensure that the provided utility will be started after the - DAEMON pseudo-service. It also provides a method - for setting and tracking the PID, or process - ID file. + DAEMON pseudo-service. It also provides a + method for setting and tracking the PID, or + process ID file. This application could then have the following line placed in /etc/rc.conf: @@ -415,7 +438,8 @@ command line arguments, inclusion of the default functions provided in /etc/rc.subr, compatibility with the &man.rcorder.8; utility and provides for easier - configuration via the rc.conf file. + configuration via the rc.conf + file. @@ -423,38 +447,37 @@ Other services, such as POP3 server daemons, IMAP, etc. could be started using - &man.inetd.8;. This involves installing the service - utility from the Ports Collection with a configuration line - added to the /etc/inetd.conf file, - or by uncommenting one of the current configuration lines. Working + &man.inetd.8;. This involves installing the service utility + from the Ports Collection with a configuration line added to + the /etc/inetd.conf file, or by + uncommenting one of the current configuration lines. Working with inetd and its configuration is described in depth in the inetd section. In some cases it may make more sense to use the &man.cron.8; daemon to start system services. This approach - has a number of advantages because cron runs - these processes as the crontab's file - owner. This allows regular users to start and maintain some - applications. + has a number of advantages because cron + runs these processes as the crontab's + file owner. This allows regular users to start and maintain + some applications. The cron utility provides a unique - feature, @reboot, which may be used in place - of the time specification. This will cause the job to be run - when &man.cron.8; is started, normally during system + feature, @reboot, which may be used in + place of the time specification. This will cause the job to + be run when &man.cron.8; is started, normally during system initialization. - - - Tom - Rhodes - Contributed by - + + Tom + Rhodes + Contributed by + @@ -463,41 +486,42 @@ cron configuration - One of the most useful utilities in &os; is &man.cron.8;. The - cron utility runs in the background and constantly - checks the /etc/crontab file. The cron - utility also checks the /var/cron/tabs directory, in - search of new crontab files. These - crontab files store information about specific - functions which cron is supposed to perform at - certain times. + One of the most useful utilities in &os; is &man.cron.8;. + The cron utility runs in the background and + constantly checks the /etc/crontab file. + The cron utility also checks the + /var/cron/tabs directory, + in search of new crontab files. These + crontab files store information about + specific functions which cron is supposed to + perform at certain times. - The cron utility uses two different - types of configuration files, the system crontab and user - crontabs. These formats only differ in the sixth field and - later. In the system crontab, cron will run - the command as the user specified in the sixth field. In a user - crontab, all commands run as the user who created the crontab, - so the sixth field is the last field; this is an important - security feature. The final field is always the command - to run. + The cron utility uses two different types + of configuration files, the system crontab and user crontabs. + These formats only differ in the sixth field and later. In the + system crontab, cron will run the command as + the user specified in the sixth field. In a user crontab, all + commands run as the user who created the crontab, so the sixth + field is the last field; this is an important security feature. + The final field is always the command to run. - User crontabs allow individual users to schedule tasks without the - need for root privileges. Commands in a user's crontab run with the - permissions of the user who owns the crontab. + User crontabs allow individual users to schedule tasks + without the need for root privileges. + Commands in a user's crontab run with the permissions of the + user who owns the crontab. - The root user can have a user crontab just like - any other user. The root user crontab is - separate from /etc/crontab (the system - crontab). Because the system crontab effectively - invokes the specified commands as root there is usually no need to - create a user crontab for root. + The root user can have a user crontab + just like any other user. The root user + crontab is separate from /etc/crontab + (the system crontab). Because the system crontab effectively + invokes the specified commands as root there is usually no + need to create a user crontab for + root. - Let us take a look at the /etc/crontab file - (the system crontab): - + Let us take a look at the /etc/crontab + file (the system crontab): # /etc/crontab - root's crontab for &os; # @@ -512,61 +536,72 @@ #minute hour mday month wday who command # # -*/5 * * * * root /usr/libexec/atrun - +*/5 * * * * root /usr/libexec/atrun >>> TRUNCATED FOR MAIL (1000 lines) <<<