Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 3 May 2009 17:26:09 GMT
From:      Rene Ladan <rene@FreeBSD.org>
To:        Perforce Change Reviews <perforce@FreeBSD.org>
Subject:   PERFORCE change 161500 for review
Message-ID:  <200905031726.n43HQ9XU089565@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
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 @@
   </sect1>
 
   <sect1 id="ro-fs">
-    <title><filename>rc.initdiskless</filename> and Read-Only Filesystems</title>
+    <title>The <literal>rc</literal> Subsystem and Read-Only Filesystems</title>
 
     <para>The post-boot initialization of an embedded FreeBSD system is
-      controlled by <filename>/etc/rc.initdiskless</filename>.
-<!--XXX (rene) obsolete, alternative needed?
-      This initialization script is invoked by placing a line in
-      <filename>/etc/rc.conf</filename> as follows:--></para>
-<!--
-    <programlisting>diskless_mount=/etc/rc.initdiskless</programlisting>
--->
-    <para><filename>rc.initdiskless</filename> mounts <filename>/var</filename>
+      controlled by <filename>/etc/rc.initdiskless</filename>.</para>
+
+    <para><filename>/etc/rc.d/var</filename> mounts <filename>/var</filename>
       as a memory filesystem, makes a configurable list of directories in
       <filename>/var</filename> with the &man.mkdir.1; command, changes modes
       on some of those directories.  In the execution of
-      <filename>/etc/rc.initdiskless</filename>, one other
-      <filename>rc.conf</filename> variable comes into play -
-      <literal>varsize</literal>.  The <filename>/etc/rc.initdiskless</filename>
+      <filename>/etc/rc.d/var</filename>, one other
+      <filename>rc.conf</filename> variable comes into play &ndash;
+      <literal>varsize</literal>.  The <filename>/etc/rc.d/var</filename>
       file creates a <filename>/var</filename> partition based on the value of
       this variable in <filename>rc.conf</filename>:</para>
 
     <programlisting>varsize=8192</programlisting>
 
-    <para>Remember that this value is in sectors.</para>
+    <para>Remember that this value is in sectors by default.</para>
 
-    <para>It is important to remember that the
-      <filename>/etc/rc.initdiskless</filename> script assumes that you have
-      already removed your conventional <filename>/tmp</filename> partition
-      and replaced it with a symbolic link to <filename>/var/tmp</filename>.
-      Because <filename>tmp</filename> is one of the directories created in
-      <filename>/var</filename> by the <filename>/etc/rc.initdiskless</filename>
-      script, and because <filename>/var</filename> is a memory filesystem
-      (which is mounted read-write), <filename>/tmp</filename> will now be a
-      directory that is read-write as well.</para>
-
     <para>The fact that <filename>/var</filename> and
       <filename>/dev</filename> are read-write filesystems is an important
       distinction, as the <filename>/</filename> 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
-      <literal>swap</literal> and <literal>/proc</literal> entries from your
+      <literal>swap</literal> entry from your
       <filename>/etc/fstab</filename> file, you should also change the Options
       field for each filesystem to <literal>ro</literal> as follows:</para>
 
@@ -200,15 +185,13 @@
 /dev/ad0s1a             /               ufs     ro              1       1</programlisting>
 
     <para>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
-      <filename>/var/db/port.mkversion</filename> 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
       <filename>/var</filename> created by
-      <filename>/etc/rc.initdiskless</filename>, and syslog and dhcp will
+      <filename>/etc/rc.d/var</filename>, and syslog and dhcp will
       encounter problems as well as a result of the read-only filesystem and
       missing items in the <filename>/var</filename> that
-      <filename>/etc/rc.initdiskless</filename> has created.  These are only
+      <filename>/etc/rc.d/var</filename> has created.  These are only
       temporary problems though, and are addressed, along with solutions to
       the execution of other common software packages in
       <xref linkend="strategies">.</para>
@@ -352,7 +335,7 @@
 
     <para>In <xref linkend="ro-fs">, it was pointed out that the
       <filename>/var</filename> filesystem constructed by
-      <filename>/etc/rc.initdiskless</filename> and the presence of a read-only
+      <filename>/etc/rc.d/var</filename> 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 @@
     <sect2>
       <title>cron</title>
 
-      <para>In <filename>/etc/rc.initdiskless</filename> there is a variable
-	named <literal>var_dirs</literal>.  This variable consists of a
-	space-delimited list of directories that will be created inside of
-	<filename>/var</filename> after it is mounted as a memory filesystem.
-	<filename>cron</filename> and <filename>cron/tabs</filename> are not
-	in that list, and without those directories, cron will complain.  By
-	inserting <literal>cron</literal>, <literal>cron/tabs</literal>, and
-	perhaps even <literal>at</literal>, and <literal>at/jobs</literal> as
-	elements of that variable, you will facilitate the running of the
-	&man.cron.8; and &man.at.1; daemons.</para>
+      <para>Upon boot, <filename class="directory">/var</filename> gets
+	populated by <filename>/etc/rc.d/var</filename> using the list from
+	<filename>/etc/mtree/BSD.var.dist</filename>, so the <filename
+	  class="directory">cron</filename>, <filename
+	  class="directory">cron/tabs</filename>, and <filename
+	  class="directory">at</filename> directories get created.</para>
 
-      <para>However, this still does not solve the problem of maintaining cron
+      <para>However, this does not solve the problem of maintaining cron
 	tabs across reboots.  When the system reboots, the
 	<filename>/var</filename> filesystem that is in memory will disappear
 	and any cron tabs you may have had in it will also disappear.
@@ -392,9 +371,9 @@
 
       <para><filename>syslog.conf</filename> specifies the locations of
 	certain log files that exist in <filename>/var/log</filename>.  These
-	files are not created by <filename>/etc/rc.initdiskless</filename> upon
+	files are not created by <filename>/etc/rc.d/var</filename> upon
 	system initialization. Therefore, somewhere in
-	<filename>/etc/rc.initdiskless</filename>, after the section that creates
+	<filename>/etc/rc.d/var</filename>, after the section that creates
 	the directories in <filename>/var</filename>, you will need to add
 	something like this:</para>
 
@@ -402,7 +381,7 @@
 &prompt.root; <userinput>chmod 0644 /var/log/*</userinput></screen>
 
       <para>You will also need to add the log directory to the list of
-	directories that <filename>/etc/rc.initdiskless</filename>
+	directories that <filename>/etc/rc.d/var</filename>
 	creates.</para>
     </sect2>
 
@@ -433,7 +412,7 @@
 
       <screen>&prompt.root; <userinput>mkdir /etc/pkg</userinput></screen>
 
-      <para>Now, add a line to <filename>/etc/rc.initdiskless</filename> that
+      <para>Now, add a line to <filename>/etc/rc.d/var</filename> that
 	links the <filename>/etc/pkg</filename> directory to
 	<filename>/var/db/pkg</filename>.  An example:</para>
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200905031726.n43HQ9XU089565>