review section on plc-config-tty to reflect recent changes
[myplc.git] / doc / myplc.xml
index f5bc22f..4522b6b 100644 (file)
         <authorinitials>MLH</authorinitials>
         <revdescription><para>Add development environment.</para></revdescription>
       </revision>
+      <revision>
+        <revnumber>1.2</revnumber>
+        <date>August 18, 2006</date>
+        <authorinitials>TPT</authorinitials>
+        <revdescription>
+       <para>Review section on configuration and introduce <command>plc-config-tty</command>.</para>
+       <para>Present implementation details last.</para>
+       </revdescription>
+      </revision>
     </revhistory>
   </articleinfo>
 
   some known limitations to this, so here are a couple notes as a
   recommended reading before you proceed with the installation.</para>
 
-  <para> As of 9 August 2006 (i.e <emphasis>myplc-0.5</emphasis>) :</para>
+  <para> As of 17 August 2006 (i.e <emphasis>myplc-0.5-2</emphasis>) :</para>
 
   <itemizedlist>
   <listitem><para> The software is vastly based on <emphasis>Fedora
 
     </section>
 
-    <section id="ChangingTheConfiguration">
+    <section id="Configuration">
       <title>Changing the configuration</title>
 
       <para>After verifying that MyPLC is working correctly, shut it
       down and begin changing some of the default variable
       values. Shut down MyPLC with <command>service plc stop</command>
-      (see <xref linkend="QuickStart" />). With a text
-      editor, open the file
-      <filename>/etc/planetlab/plc_config.xml</filename>. This file is
-      a self-documenting configuration file written in XML. Variables
-      are divided into categories. Variable identifiers must be
-      alphanumeric, plus underscore. A variable is referred to
-      canonically as the uppercase concatenation of its category
-      identifier, an underscore, and its variable identifier. Thus, a
-      variable with an <literal>id</literal> of
+      (see <xref linkend="QuickStart" />). </para>
+
+      <para> The preferred option for changing the configuration is to
+      use the <command>plc-config-tty</command> tool. This tool comes
+      with the root image, so you need to have it mounted first. The
+      full set of applicable variables is described in <xref
+      linkend="VariablesDevel" />, but using the <command>u</command>
+      guides you to the most useful ones. Note that if you
+      plan on federating with other PLCs, <emphasis> it is strongly
+      recommended that you change the <command> PLC_NAME
+      </command> and <command> PLC_SLICE_PREFIX </command>
+      settings. </emphasis>
+      Here is sample session:
+      </para>
+
+      <example><title>Using plc-config-tty for configuration:</title>
+         <programlisting><![CDATA[# service plc mount
+Mounting PLC:                                              [  OK  ]
+# chroot /plc/root su - 
+<plc> # plc-config-tty
+Config file /etc/planetlab/configs/site.xml located under a non-existing directory
+Want to create /etc/planetlab/configs [y]/n ? y
+Created directory /etc/planetlab/configs
+Enter command (u for usual changes, w to save, ? for help) u
+== PLC_NAME : [PlanetLab Test] OneLab
+== PLC_SLICE_PREFIX : [pl] thone
+== PLC_ROOT_USER : [root@localhost.localdomain] root@onelab-plc.inria.fr
+== PLC_ROOT_PASSWORD : [root] plain-passwd
+== PLC_MAIL_ENABLED : [false] true
+== PLC_MAIL_SUPPORT_ADDRESS : [root+support@localhost.localdomain] support@one-lab.org
+== PLC_BOOT_HOST : [localhost.localdomain] onelab-plc.inria.fr
+== PLC_NET_DNS1 : [127.0.0.1] 138.96.250.248
+== PLC_NET_DNS2 : [None] 138.96.250.249
+Enter command (u for usual changes, w to save, ? for help) w
+Wrote /etc/planetlab/configs/site.xml
+Merged
+        /etc/planetlab/default_config.xml
+and     /etc/planetlab/configs/site.xml
+into    /etc/planetlab/plc_config.xml
+You might want to type 'r' (restart plc) or 'q' (quit)
+Enter command (u for usual changes, w to save, ? for help) r
+==================== Stopping plc
+...
+==================== Starting plc
+...
+Enter command (u for usual changes, w to save, ? for help) q
+<plc> # exit
+# 
+]]></programlisting>
+    </example>
+
+      <para>If you used this method for configuring, you can skip to
+      the <xref linkend="LoginRealUser" />. As an alternative to using
+      <command>plc-config-tty</command>, you may also use a text
+      editor, but this requires some understanding on how the
+      configuration files are used within myplc. The
+      <emphasis>default</emphasis> configuration is stored in a file
+      named <filename>/etc/planetlab/default_config.xml</filename>,
+      that is designed to remain intact. You may store your local
+      changes in any file located in the <filename>configs/</filename>
+      sub-directory, that are loaded on top of the defaults. Finally
+      the file <filename>/etc/planetlab/plc_config.xml</filename> is
+      loaded, and the resulting configuration is stored in the latter
+      file, that is used as a reference.</para>
+
+      <para> Using a separate file for storing local changes only, as
+      <command>plc-config-tty</command> does, is not a workable option
+      with a text editor because it would involve tedious xml
+      re-assembling. So your local changes should go in
+      <filename>/etc/planetlab/plc_config.xml</filename>. Be warned
+      however that any change you might do this way could be lost if
+      you use <command>plc-config-tty</command> later on. </para>
+
+      <para>This file is a self-documenting configuration file written
+      in XML. Variables are divided into categories. Variable
+      identifiers must be alphanumeric, plus underscore. A variable is
+      referred to canonically as the uppercase concatenation of its
+      category identifier, an underscore, and its variable
+      identifier. Thus, a variable with an <literal>id</literal> of
       <literal>slice_prefix</literal> in the <literal>plc</literal>
       category is referred to canonically as
       <envar>PLC_SLICE_PREFIX</envar>.</para>
        system.</para></listitem>
       </itemizedlist>
 
-      <para>The full set of applicable variables is described in <xref
-      linkend="VariablesDevel" />. After changing these variables,
+      <para> After changing these variables,
       save the file, then restart MyPLC with <command>service plc
       start</command>. You should notice that the password of the
       default administrator account is no longer
       <literal>root</literal>, and that the default site name includes
-      the name of your PLC installation instead of PlanetLab.</para>
+      the name of your PLC installation instead of PlanetLab. As a
+      side effect of these changes, the ISO images for the boot CDs
+      now have new names, so that you can freely remove the ones names
+      after 'PlanetLab Test', which is the default value of
+      <envar>PLC_NAME</envar> </para> 
+      </section>
+
+      <section id="LoginRealUser"> <title> Login as a real user </title>
+
+      <para>Now that myplc is up and running, you can connect to the
+      web site that by default runs on port 80. You can either
+      directly use the default administrator user that you configured
+      in <envar>PLC_ROOT_USER</envar> and
+      <envar>PLC_ROOT_PASSWORD</envar>, or create a real user through
+      the 'Joining' tab. Do not forget to  select both PI and tech
+      roles, and to select the only site created at this stage.
+      Login as the administrator to enable this user, then login as
+      the real user.</para>
       </section>
 
     <section>
@@ -422,12 +517,13 @@ PLC: Signing node packages:                                [  OK  ]
       If this step fails, it is likely that the previous step
       (<literal>Starting web server</literal>) also failed. Another
       reason that it could fail is if <envar>PLC_API_HOST</envar> (see
-      <xref linkend="ChangingTheConfiguration" />) does not resolve to
+      <xref linkend="Configuration" />) does not resolve to
       the host on which the API server has been enabled. By default,
       all services, including the API server, are enabled and run on
       the same host, so check that <envar>PLC_API_HOST</envar> is
       either <filename>localhost</filename> or resolves to a local IP
-      address.</para></listitem>
+      address. Also check that <envar>PLC_ROOT_USER</envar> looks like
+      an e-mail address.</para></listitem>
 
       <listitem><para><literal>Starting crond</literal>: If this step
       fails, it is likely that the previous steps (<literal>Starting
@@ -528,6 +624,15 @@ PLC: Signing node packages:                                [  OK  ]
          Service uses to determine the state of slices. These XML
          files are refreshed periodically by <command>cron</command>
          jobs running in the MyPLC root.</para></listitem>
+
+         <listitem><para><filename>/root</filename>: this is the
+         location of the root-user's homedir, and for your
+         convenience is stored under <filename>/data</filename> so
+         that your local customizations survive across
+         updates - this feature is inherited from the
+         <command>myplc-devel</command> package, where it is probably
+         more useful. </para></listitem> 
+
        </itemizedlist>
       </listitem>
 
@@ -598,6 +703,20 @@ PLC: Signing node packages:                                [  OK  ]
     </itemizedlist>
     </section>
 
+    <section>
+      <title>Configuration</title> 
+      
+      <para> The default configuration should work as-is on most
+      sites. Configuring the development package can be achieved in a
+      similar way as for <emphasis>myplc</emphasis>, as described in
+      <xref linkend="Configuration"
+      />. <command>plc-config-tty</command> supports a
+      <emphasis>-d</emphasis> option for supporting the
+      <emphasis>myplc-devel</emphasis> case, that can be useful in a
+      context where it would not guess it by itself.  Refer to <xref
+      linkend="VariablesDevel" /> for a list of variables.</para>
+      </section>
+
     <section id="FilesInvolvedDevel"> <title> Files and directories
     involved in <emphasis>myplc-devl</emphasis></title>
 
@@ -651,8 +770,12 @@ PLC: Signing node packages:                                [  OK  ]
            directory are themselves source controlled; see <xref
            linkend="BuildingMyPLC" /> for more information about executing
            builds.</para></listitem>
-         </itemizedlist>
-       </listitem>
+
+           <listitem><para><filename>/root</filename>: this is the
+           location of the root-user's homedir, and for your
+           convenience is stored under <filename>/data</filename> so
+           that your local customizations survive across
+           updates. </para></listitem> </itemizedlist> </listitem>
 
        <listitem>
          <para><filename>/etc/init.d/plc-devel</filename>: This file is
@@ -795,12 +918,14 @@ make -C $DATE]]></programlisting>
       <para>Because the CVS repository is not automatically upgraded,
       if you wish to keep your local repository synchronized with the
       public PlanetLab repository, it is highly recommended that you
-      use CVS's support for <ulink
-      url="http://ximbiot.com/cvs/wiki/index.php?title=CVS--Concurrent_Versions_System_v1.12.12.1:_Tracking_third-party_sources">vendor
-      branches</ulink> to track changes. Vendor branches ease the task
-      of merging upstream changes with your local modifications. To
-      import a new snapshot into your local repository (for example,
-      if you have just upgraded from
+      use CVS's support for vendor branches to track changes, as
+      described <ulink
+      url="http://ximbiot.com/cvs/wiki/index.php?title=CVS--Concurrent_Versions_System_v1.12.12.1:_Tracking_third-party_sources">here</ulink>
+      and <ulink
+      url="http://cvsbook.red-bean.com/cvsbook.html#Tracking%20Third-Party%20Sources%20(Vendor%20Branches)">here</ulink>.
+      Vendor branches ease the task of merging upstream changes with
+      your local modifications. To import a new snapshot into your
+      local repository (for example, if you have just upgraded from
       <filename>myplc-devel-0.4-2</filename> to
       <filename>myplc-devel-0.4-3</filename> and you notice the new
       repository in <filename>/plc/devel/data/cvs-0.4-3</filename>),
@@ -828,17 +953,22 @@ cvs -d /cvs rtag before-myplc-0_4-3-merge
 TMP=$(mktemp -d /data/export.XXXXXX)
 pushd $TMP
 cvs -d /data/cvs-0.4-3 export -r HEAD .
-cvs -d /cvs import -m "PlanetLab sources from myplc-0.4-3" -ko -I ! . planetlab myplc-0_4-3
+cvs -d /cvs import -m "Merging myplc-0.4-3" -ko -I ! . planetlab myplc-0_4-3
 popd
 rm -rf $TMP]]></programlisting>
       </example>
 
-      <para>If there any merge conflicts, use the command suggested by
-      CVS to help the merge. Explaining how to fix merge conflicts is
-      beyond the scope of this document; consult the CVS documentation
-      for more information on how to use CVS.</para>
-    </section>
-  </section>
+      <para>If there are any merge conflicts, use the command
+      suggested by CVS to help the merge. Explaining how to fix merge
+      conflicts is beyond the scope of this document; consult the CVS
+      documentation for more information on how to use CVS.</para>
+      </section> </section>
+
+<section><title> More information : the FAQ wiki page</title> 
+
+<para> Please refer to, and feel free to contribute, <ulink
+url="https://wiki.planet-lab.org/twiki/bin/view/Planetlab/MyplcFAQ">
+the FAQ page on the Princeton's wiki </ulink>.</para></section>
 
   <appendix id="VariablesRuntime">
     <title>Configuration variables (for <emphasis>myplc</emphasis>)</title>
@@ -850,7 +980,22 @@ rm -rf $TMP]]></programlisting>
     templates that should be placed in
     <filename>/etc/planetlab/configs/</filename>.</para>
 
-    &Variables;
+    <para>This information is available online within
+    <command>plc-config-tty</command>, e.g.:</para>
+
+<example><title>Advanced usage of plc-config-tty</title>
+<programlisting><![CDATA[<plc> # plc-config-tty
+Enter command (u for usual changes, w to save, ? for help) V plc_dns
+========== Category = PLC_DNS
+### Enable DNS
+# Enable the internal DNS server. The server does not provide reverse
+# resolution and is not a production quality or scalable DNS solution.
+# Use the internal DNS server only for small deployments or for testing.
+PLC_DNS_ENABLED
+]]></programlisting></example>
+
+  <para> List of the <command>myplc</command> configuration variables:</para>
+   &Variables;
   </appendix>
 
   <appendix id="VariablesDevel">