From owner-p4-projects@FreeBSD.ORG Sun May 3 17:26:10 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 78D161065670; Sun, 3 May 2009 17:26:10 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 07E12106566C for ; Sun, 3 May 2009 17:26:10 +0000 (UTC) (envelope-from rene@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id E91BD8FC26 for ; Sun, 3 May 2009 17:26:09 +0000 (UTC) (envelope-from rene@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n43HQ9n7089567 for ; Sun, 3 May 2009 17:26:09 GMT (envelope-from rene@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n43HQ9XU089565 for perforce@freebsd.org; Sun, 3 May 2009 17:26:09 GMT (envelope-from rene@FreeBSD.org) Date: Sun, 3 May 2009 17:26:09 GMT Message-Id: <200905031726.n43HQ9XU089565@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to rene@FreeBSD.org using -f From: Rene Ladan To: Perforce Change Reviews Cc: Subject: PERFORCE change 161500 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 May 2009 17:26:11 -0000 http://perforce.freebsd.org/chv.cgi?CH=161500 Change 161500 by rene@rene_self on 2009/05/03 17:25:56 solid-state article: * remove last instance of /var/db/port.mkversion * no more /proc in /etc/fstab nowadays * replace some /etc/rc.initdiskless by /etc/rc.d/var * /etc/mtree/BSD.var.dist is now used instead of a var_dirs list, which includes cron/, cron/tabs/ and at/ * minor language fixes * the rc subsystem doesn't assume /tmp points to /var/tmp * the boot scripts recognize a diskless system automatically nowadays Affected files ... .. //depot/projects/docproj_nl/en_US.ISO8859-1/articles/solid-state/article.sgml#11 edit Differences ... ==== //depot/projects/docproj_nl/en_US.ISO8859-1/articles/solid-state/article.sgml#11 (text+ko) ==== @@ -147,40 +147,25 @@ - <filename>rc.initdiskless</filename> and Read-Only Filesystems + The <literal>rc</literal> Subsystem and Read-Only Filesystems The post-boot initialization of an embedded FreeBSD system is - controlled by /etc/rc.initdiskless. - - - rc.initdiskless mounts /var + controlled by /etc/rc.initdiskless. + + /etc/rc.d/var mounts /var as a memory filesystem, makes a configurable list of directories in /var with the &man.mkdir.1; command, changes modes on some of those directories. In the execution of - /etc/rc.initdiskless, one other - rc.conf variable comes into play - - varsize. The /etc/rc.initdiskless + /etc/rc.d/var, one other + rc.conf variable comes into play – + varsize. The /etc/rc.d/var file creates a /var partition based on the value of this variable in rc.conf: varsize=8192 - Remember that this value is in sectors. + Remember that this value is in sectors by default. - It is important to remember that the - /etc/rc.initdiskless script assumes that you have - already removed your conventional /tmp partition - and replaced it with a symbolic link to /var/tmp. - Because tmp is one of the directories created in - /var by the /etc/rc.initdiskless - script, and because /var is a memory filesystem - (which is mounted read-write), /tmp will now be a - directory that is read-write as well. - The fact that /var and /dev are read-write filesystems is an important distinction, as the / partition (and any other @@ -192,7 +177,7 @@ swap file on a busy system can burn through a piece of flash media in less than one year. Heavy logging or temporary file creation and destruction can do the same. Therefore, in addition to removing the - swap and /proc entries from your + swap entry from your /etc/fstab file, you should also change the Options field for each filesystem to ro as follows: @@ -200,15 +185,13 @@ /dev/ad0s1a / ufs ro 1 1 A few applications in the average system will immediately begin to - fail as a result of this change. For instance, ports will not install - from the ports tree because the - /var/db/port.mkversion file does not exist. cron + fail as a result of this change. For instance, cron will not run properly as a result of missing cron tabs in the /var created by - /etc/rc.initdiskless, and syslog and dhcp will + /etc/rc.d/var, and syslog and dhcp will encounter problems as well as a result of the read-only filesystem and missing items in the /var that - /etc/rc.initdiskless has created. These are only + /etc/rc.d/var has created. These are only temporary problems though, and are addressed, along with solutions to the execution of other common software packages in . @@ -352,7 +335,7 @@ In , it was pointed out that the /var filesystem constructed by - /etc/rc.initdiskless and the presence of a read-only + /etc/rc.d/var and the presence of a read-only root filesystem causes problems with many common software packages used with FreeBSD. In this article, suggestions for successfully running cron, syslog, ports installations, and the Apache web server will be @@ -361,18 +344,14 @@ cron - In /etc/rc.initdiskless there is a variable - named var_dirs. This variable consists of a - space-delimited list of directories that will be created inside of - /var after it is mounted as a memory filesystem. - cron and cron/tabs are not - in that list, and without those directories, cron will complain. By - inserting cron, cron/tabs, and - perhaps even at, and at/jobs as - elements of that variable, you will facilitate the running of the - &man.cron.8; and &man.at.1; daemons. + Upon boot, /var gets + populated by /etc/rc.d/var using the list from + /etc/mtree/BSD.var.dist, so the cron, cron/tabs, and at directories get created. - However, this still does not solve the problem of maintaining cron + However, this does not solve the problem of maintaining cron tabs across reboots. When the system reboots, the /var filesystem that is in memory will disappear and any cron tabs you may have had in it will also disappear. @@ -392,9 +371,9 @@ syslog.conf specifies the locations of certain log files that exist in /var/log. These - files are not created by /etc/rc.initdiskless upon + files are not created by /etc/rc.d/var upon system initialization. Therefore, somewhere in - /etc/rc.initdiskless, after the section that creates + /etc/rc.d/var, after the section that creates the directories in /var, you will need to add something like this: @@ -402,7 +381,7 @@ &prompt.root; chmod 0644 /var/log/* You will also need to add the log directory to the list of - directories that /etc/rc.initdiskless + directories that /etc/rc.d/var creates. @@ -433,7 +412,7 @@ &prompt.root; mkdir /etc/pkg - Now, add a line to /etc/rc.initdiskless that + Now, add a line to /etc/rc.d/var that links the /etc/pkg directory to /var/db/pkg. An example: