Author: dj
Date: Fri Jun 10 22:26:20 2016
New Revision: 17478

Log:
[Systemd merge] - Chapter 16

Modified:
   trunk/BOOK/networking/netprogs/cifsutils.xml
   trunk/BOOK/networking/netprogs/netfs.xml
   trunk/BOOK/networking/netprogs/nfs-utils.xml
   trunk/BOOK/networking/netprogs/ntp.xml
   trunk/BOOK/networking/netprogs/rpcbind.xml
   trunk/BOOK/networking/netprogs/rsync.xml
   trunk/BOOK/networking/netprogs/samba.xml
   trunk/BOOK/networking/netprogs/wpa_supplicant.xml

Modified: trunk/BOOK/networking/netprogs/cifsutils.xml
==============================================================================
--- trunk/BOOK/networking/netprogs/cifsutils.xml        Fri Jun 10 14:58:35 
2016        (r17477)
+++ trunk/BOOK/networking/netprogs/cifsutils.xml        Fri Jun 10 22:26:20 
2016        (r17478)
@@ -98,11 +98,15 @@
     <para>Install <application>cifs-utils</application> by running the 
following
     commands:</para>
 
-<screen><userinput>./configure --prefix=/usr \
+<screen revision="sysv"><userinput>./configure --prefix=/usr \
             --disable-pam \
             --disable-systemd &amp;&amp;
 make</userinput></screen>
 
+<screen revision="systemd"><userinput>./configure --prefix=/usr \
+            --disable-pam &amp;&amp;
+make</userinput></screen>
+
     <para>This package does not come with a test suite.</para>
 
     <para>Now, as the <systemitem class="username">root</systemitem> 
user:</para>
@@ -119,9 +123,10 @@
             if <xref linkend="linux-pam"/> is installed and you wish
             PAM support.</para>
 
-          <para><parameter>--disable-systemd</parameter>: Disable systemd
-            specific behavior for <command>mount.cifs</command>. Remove it for
-            systems running with systemd.</para>
+          <para revision="sysv"><parameter>--disable-systemd</parameter>:
+            Disable systemd specific behavior for
+            <command>mount.cifs</command>. Remove it for systems running with
+            systemd.</para>
 
           <para><option>--with-pamdir=/lib/security</option>: Install the PAM
             module in

Modified: trunk/BOOK/networking/netprogs/netfs.xml
==============================================================================
--- trunk/BOOK/networking/netprogs/netfs.xml    Fri Jun 10 14:58:35 2016        
(r17477)
+++ trunk/BOOK/networking/netprogs/netfs.xml    Fri Jun 10 22:26:20 2016        
(r17478)
@@ -35,5 +35,4 @@
 
 <screen role='root'><userinput>make install-netfs</userinput></screen>
 
-  <para revision="systemd">TBA</para>
 </sect1>

Modified: trunk/BOOK/networking/netprogs/nfs-utils.xml
==============================================================================
--- trunk/BOOK/networking/netprogs/nfs-utils.xml        Fri Jun 10 14:58:35 
2016        (r17477)
+++ trunk/BOOK/networking/netprogs/nfs-utils.xml        Fri Jun 10 22:26:20 
2016        (r17478)
@@ -69,7 +69,9 @@
     <para role="optional">
       <xref linkend="libevent"/>,
       <xref linkend="sqlite"/> and
-      <ulink 
url="http://www.citi.umich.edu/projects/nfsv4/linux/";>libnfsidmap</ulink> (for 
NFSv4 support),
+      <phrase revision="sysv"><ulink 
url="http://www.citi.umich.edu/projects/nfsv4/linux/";>libnfsidmap</ulink></phrase>
+      <phrase revision="systemd"><xref linkend="libnfsidmap"/></phrase>
+      (for NFSv4 support),
       <xref linkend="mitkrb"/> or
       <ulink 
url="http://www.citi.umich.edu/projects/nfsv4/linux/";>libgssapi</ulink>, and
       <ulink 
url="http://www.citi.umich.edu/projects/nfsv4/linux/";>librpcsecgss</ulink> (for 
GSS and RPC security support) and
@@ -217,37 +219,66 @@
       </indexterm>
 
       <sect4 id="nfs-utils-server-init">
-        <title>Boot Script</title>
+        <title><phrase revision="sysv">Boot Script</phrase>
+               <phrase revision="systemd">Systemd Units</phrase></title>
 
-        <para>Install the <filename>/etc/rc.d/init.d/nfs-server</filename>
-        init script included in the <xref linkend="bootscripts" 
revision="sysv"/>
+        <para>Install the
+        <phrase 
revision="sysv"><filename>/etc/rc.d/init.d/nfs-server</filename>
+        init script</phrase>
+        <phrase revision="systemd">NFSv4 server units</phrase>
+        included in the <xref linkend="bootscripts" revision="sysv"/>
         <xref linkend="systemd-units" revision="systemd"/> package
         to start the server at boot.</para>
 
+<screen role="root" revision="systemd"><userinput>make 
install-nfsv4-server</userinput></screen>
+
+        <para revision="systemd">
+          If you have disabled NFSv4 support, run the following command as the
+          <systemitem class="username">root</systemitem> user to omit the NFSv4
+          specific systemd units:
+        </para>
+
+<!-- both -->
 <screen role="root"><userinput>make install-nfs-server</userinput></screen>
 
-        <indexterm zone="nfs-utils nfs-utils-server-init">
+        <indexterm zone="nfs-utils nfs-utils-server-init" revision="sysv">
           <primary sortas="f-nfs-server">nfs-server</primary>
         </indexterm>
 
-        <para>Now create the <filename>/etc/sysconfig/nfs-server</filename>
-        configuration file:</para>
+        <para revision="sysv">Now create the
+          <filename>/etc/sysconfig/nfs-server</filename> configuration file:
+        </para>
 
-<screen role="root"><userinput>cat &gt; /etc/sysconfig/nfs-server &lt;&lt; 
"EOF"
+<screen role="root" revision="sysv"><userinput>cat &gt; 
/etc/sysconfig/nfs-server &lt;&lt; "EOF"
 <literal>PORT="2049"
 PROCESSES="8"
 QUOTAS="no"
 KILLDELAY="10"</literal>
 EOF</userinput></screen>
 
-        <note><para>The above parameters may be optionally placed in
-        <filename>/etc/sysconfig/rc.site</filename>.</para></note>
+        <note revision="sysv">
+          <para>The above parameters may be optionally placed in
+            <filename>/etc/sysconfig/rc.site</filename>.
+          </para>
+        </note>
 
-        <indexterm zone="nfs-utils nfs-utils-server-init">
+        <indexterm zone="nfs-utils nfs-utils-server-init" revision="sysv">
           <primary
           
sortas="e-etc-sysconfig-nfs-server">/etc/sysconfig/nfs-server</primary>
         </indexterm>
 
+        <para revision="systemd">
+          You can edit the <filename>/etc/default/nfs-utils</filename>
+          file to change the startup options for NFS daemons. Defaults
+          should be fine for most use cases.
+        </para>
+
+        <indexterm zone="nfs-utils nfs-utils-server-init" revision="systemd">
+          <primary 
sortas="e-etc-default-nfs-utils">/etc/default/nfs-utils</primary>
+        </indexterm>
+
+
+
       </sect4>
 
     </sect3>
@@ -286,13 +317,23 @@
       </indexterm>
 
       <sect4  id="nfs-utils-client-init">
-        <title>Boot Script</title>
+        <title><phrase revision="sysv">Boot Script</phrase>
+               <phrase revision="systemd">Systemd Units</phrase></title>
 
-        <note><para>The following boot script is not required if the
-        nfs-server script is installed.</para></note>
-
-        <para>Install the <filename>/etc/rc.d/init.d/nfs-client</filename> init
-        script included in the <xref linkend="bootscripts" revision="sysv"/>
+        <note>
+          <para>
+            The following <phrase revision="sysv">boot script is</phrase>
+            <phrase revision="systemd">systemd units are</phrase> not required
+            if the nfs-server <phrase revision="sysv">script is</phrase> 
+            <phrase revision="systemd">units are</phrase> installed.
+          </para>
+        </note>
+
+        <para>Install the
+        <phrase revision="sysv">
+        <filename>/etc/rc.d/init.d/nfs-client</filename> init script</phrase>
+        <phrase revision="systemd">units</phrase> included in the
+        <xref linkend="bootscripts" revision="sysv"/>
         <xref linkend="systemd-units" revision="systemd"/> package to start
         the client services at boot.</para>
 
@@ -307,7 +348,7 @@
         to install the <filename>netfs</filename> bootscript as described in
         <xref linkend="postlfs-config-netfs"/>.</para>
 
-        <indexterm zone="nfs-utils nfs-utils-client-config">
+        <indexterm zone="nfs-utils nfs-utils-client-config" revision="sysv">
           <primary sortas="f-netfs">netfs</primary>
         </indexterm>
 

Modified: trunk/BOOK/networking/netprogs/ntp.xml
==============================================================================
--- trunk/BOOK/networking/netprogs/ntp.xml      Fri Jun 10 14:58:35 2016        
(r17477)
+++ trunk/BOOK/networking/netprogs/ntp.xml      Fri Jun 10 22:26:20 2016        
(r17478)
@@ -214,15 +214,21 @@
       and update the time each time <command>ntpd</command> is 
scheduled.</para>
 
       <para>If you choose Option one, then install the
-      <filename>/etc/rc.d/init.d/ntp</filename>
-      init script included in the
+      <phrase revision="sysv"><filename>/etc/rc.d/init.d/ntp</filename>
+      init script</phrase>
+      <phrase revision="systemd"><filename>ntpd.service</filename> 
unit</phrase>
+      included in the
       <xref linkend="bootscripts" revision="sysv"/>
       <xref linkend="systemd-units" revision="systemd"/> package.</para>
 
-      <indexterm zone="ntp ntp-init">
+      <indexterm zone="ntp ntp-init" revision="sysv">
         <primary sortas="f-ntp">ntp</primary>
       </indexterm>
 
+      <indexterm zone="ntp ntp-init" revision="systemd">
+        <primary sortas="f-ntpd">ntpd.service</primary>
+      </indexterm>
+
 <screen role="root"><userinput>make install-ntpd</userinput></screen>
 
       <para>If you prefer to run <command>ntpd</command> periodically, add the
@@ -231,13 +237,15 @@
 
 <screen><literal>ntpd -q</literal></screen>
 
-      <para>Execute the following command if you would like to set the
-      hardware clock to the current system time at shutdown and reboot:</para>
+      <para revision="sysv">Execute the following command if you would like to
+      set the hardware clock to the current system time at shutdown and
+      reboot:</para>
 
-<screen role="root"><userinput>ln -v -sf ../init.d/setclock 
/etc/rc.d/rc0.d/K46setclock &amp;&amp;
+<screen role="root" revision="sysv"><userinput>ln -v -sf ../init.d/setclock 
/etc/rc.d/rc0.d/K46setclock &amp;&amp;
 ln -v -sf ../init.d/setclock /etc/rc.d/rc6.d/K46setclock</userinput></screen>
 
-      <para>The other way around is already set up by LFS.</para>
+      <para revision="sysv">The other way around is already set up by
+      LFS.</para>
 
     </sect3>
 

Modified: trunk/BOOK/networking/netprogs/rpcbind.xml
==============================================================================
--- trunk/BOOK/networking/netprogs/rpcbind.xml  Fri Jun 10 14:58:35 2016        
(r17477)
+++ trunk/BOOK/networking/netprogs/rpcbind.xml  Fri Jun 10 22:26:20 2016        
(r17478)
@@ -82,6 +82,17 @@
   <sect2 role="installation">
     <title>Installation of rpcbind</title>
 
+    <para revision="systemd">
+      There should be a dedicated user and group to take control
+      of the <command>rpcbind</command> daemon after it is started.
+      Issue the following commands as the
+      <systemitem class="username">root</systemitem> user:
+    </para>
+
+<screen role="root" revision="systemd"><userinput>groupadd -g 28 rpc &amp;&amp;
+useradd -c "RPC Bind Daemon Owner" -d /dev/null -g rpc \
+        -s /bin/false -u 28 rpc</userinput></screen>
+
     <!-- Packages should adapt to standards, not the other way around -->
     <para>In order to get <application>rpcbind</application> to work
     properly, first fix the package to use correct service name:</para>
@@ -101,9 +112,9 @@
 
 <screen revision="systemd"><userinput>patch -Np1 -i 
../rpcbind-&rpcbind-version;-tirpc_fix-1.patch &amp;&amp;
 
-./configure --prefix=/usr       \
-            --bindir=/sbin      \
-            --with-rpcuser=root &amp;&amp;
+./configure --prefix=/usr  \
+            --bindir=/sbin \
+            --with-rpcuser=rpc &amp;&amp;
 make</userinput></screen>
 
     <para>This package does not come with a test suite.</para>
@@ -117,28 +128,42 @@
   <sect2 role="commands">
     <title>Command Explanations</title>
 
-    <para><command>--with-rpcuser=root</command>: This works around an error in
-    the configure script.</para>
+    <para revision="sysv"><command>--with-rpcuser=root</command>: This works
+    around an error in the configure script.</para>
 
     <para revision="sysv"><command>--without-systemdsystemunitdir</command>:
     BLFS does not support systemd.</para>
 
+    <para revision="systemd"><parameter>--with-rpcuser=rpc</parameter>:
+    This switch is used so the <command>rpcbind</command> daemon will
+    run as an unprivileged user instead of the
+    <systemitem class="username">root</systemitem> user.</para>
+
   </sect2>
 
   <sect2 role="configuration">
     <title>Configuring rpcbind</title>
 
     <sect3 id="rpcbind-init">
-      <title>Boot Script</title>
+      <title><phrase revision="sysv">Boot Script</phrase>
+             <phrase revision="systemd">Systemd Unit</phrase></title>
 
-      <para>Install the <filename>/etc/rc.d/init.d/rpcbind</filename> init
-      script included in the <xref linkend="bootscripts" revision="sysv"/>
+      <para>Install the
+      <phrase revision="sysv"><filename>/etc/rc.d/init.d/rpcbind</filename>
+      init script</phrase>
+      <phrase revision="systemd"><filename>rpcbind.service</filename>
+      unit</phrase> included in the
+      <xref linkend="bootscripts" revision="sysv"/>
       <xref linkend="systemd-units" revision="systemd"/> package.</para>
 
-      <indexterm zone="rpcbind rpcbind-init">
+      <indexterm zone="rpcbind rpcbind-init" revision="sysv">
          <primary sortas="f-rpcbind">rpcbind</primary>
       </indexterm>
 
+      <indexterm zone="rpcbind rpcbind-init" revision="systemd">
+         <primary sortas="f-rpcbind">rpcbind.service</primary>
+      </indexterm>
+
 <screen role="root"><userinput>make install-rpcbind</userinput></screen>
 
     </sect3>

Modified: trunk/BOOK/networking/netprogs/rsync.xml
==============================================================================
--- trunk/BOOK/networking/netprogs/rsync.xml    Fri Jun 10 14:58:35 2016        
(r17477)
+++ trunk/BOOK/networking/netprogs/rsync.xml    Fri Jun 10 22:26:20 2016        
(r17478)
@@ -164,21 +164,52 @@
     </sect3>
 
     <sect3 id="rsync-init">
-      <title>Boot Script</title>
+      <title><phrase revision="sysv">Boot Script</phrase>
+             <phrase revision="systemd">Systemd Unit</phrase></title>
 
       <para>Note that you only want to start the
       <application>rsync</application> server if you want to provide an
       <application>rsync</application> archive on your local machine.
-      You don't need this script to run the
+      You don't need this <phrase revision="sysv">script</phrase>
+      <phrase revision="systemd">unit</phrase> to run the
       <application>rsync</application> client.</para>
 
-      <para>Install the <filename>/etc/rc.d/init.d/rsyncd</filename> init
-      script included in the
+      <para>Install the
+      <phrase revision="sysv"><filename>/etc/rc.d/init.d/rsyncd</filename> init
+      script</phrase>
+      <phrase revision="systemd"><filename>rsyncd.service</filename>
+      unit</phrase> included in the
       <xref linkend="bootscripts" revision="sysv"/>
       <xref linkend="systemd-units" revision="systemd"/> package.</para>
 
 <screen role="root"><userinput>make install-rsyncd</userinput></screen>
 
+      <note revision="systemd">
+        <para>This package comes with two types of units: A service file and a
+        socket file. The service file will start rsync daemon once at boot
+        and it will keep running until the system shuts down. The socket file
+        will make systemd listen on rsync port (Default 873, needs to be
+        edited for anything else) and will start rsync daemon when something
+        tries to connect to that port and stop the daemon when the connection
+        is terminated. This is called socket activation and is analogous to
+        using <application>{,x}inetd</application> on a SysVinit based 
+        system.</para>
+
+
+        <para>By default, the first method is used - rsync daemon is started
+        at boot and stopped at shutdown. If the socket method is desired, you
+        need to run as the
+        <systemitem class="username">root</systemitem> user:</para>
+
+<screen role="root"><userinput>systemctl stop rsyncd &amp;&amp;
+systemctl disable rsyncd &amp;&amp;
+systemctl enable rsyncd.socket &amp;&amp;
+systemctl start rsyncd.socket</userinput></screen>
+
+        <para>Note that socket method is only useful for remote backups. For
+        local backups you'll need the service method.</para>
+      </note>
+
     </sect3>
 
   </sect2>

Modified: trunk/BOOK/networking/netprogs/samba.xml
==============================================================================
--- trunk/BOOK/networking/netprogs/samba.xml    Fri Jun 10 14:58:35 2016        
(r17477)
+++ trunk/BOOK/networking/netprogs/samba.xml    Fri Jun 10 22:26:20 2016        
(r17478)
@@ -120,7 +120,7 @@
     <para>Install <application>Samba</application> by running the following
     commands:</para>
 
-<screen><userinput>./configure                            \
+<screen revision="sysv"><userinput>./configure                            \
     --prefix=/usr                      \
     --sysconfdir=/etc                  \
     --localstatedir=/var               \
@@ -131,6 +131,15 @@
     --without-systemd                  &amp;&amp;
 make</userinput></screen>
 
+<screen revision="systemd"><userinput>./configure                            \
+    --prefix=/usr                      \
+    --sysconfdir=/etc                  \
+    --localstatedir=/var               \
+    --with-piddir=/run/samba           \
+    --with-pammodulesdir=/lib/security \
+    --enable-fhs &amp;&amp;
+make</userinput></screen>
+
 <!--
     <para>According to <application>Samba</application> developers, the
     limitation to 108 characters of the path length of a unix named pipe socket
@@ -182,16 +191,16 @@
     <para><parameter>--enable-fhs</parameter>: Assigns all other file paths in
     a manner compliant with the Filesystem Hierarchy Standard (FHS).</para>
 
-    <para><parameter>--without-systemd</parameter>: Disable
+    <para revision="sysv"><parameter>--without-systemd</parameter>: Disable
     <application>systemd</application> integration, which is not part of
     LFS/BLFS. If you use <application>systemd</application>, replace by
     <parameter>--with-systemd</parameter>.</para>
 
-    <para><option>--without-ad-dc</option>: Disable Active Directory Domain
-    Controller functionality. See <ulink
+    <para revision="sysv"><option>--without-ad-dc</option>: Disable Active
+    Directory Domain Controller functionality. See <ulink
     
url="https://wiki.samba.org/index.php/Setup_a_Samba_Active_Directory_Domain_Controller";>
     Setup a Samba Active Directory Domain Controller</ulink> for detailed
-    information. </para>
+    information.</para>
 
     <para><option>--with-selftest-prefix=SELFTEST_PREFIX</option>: This option
     specify the test suite work directory (default=./st).</para>
@@ -202,7 +211,8 @@
 
     <para><command>ln -v -sf ../../lib/libnss_winbind.so.2 
/usr/lib/libnss_winbind.so</command>
     and <command>ln -v -sf ../../lib/libnss_wins.so.2    
/usr/lib/libnss_wins.so</command>:
-    These symlinks are required when applicates build against these 
libraries.</para>
+    These symlinks are required when applicationss build against these
+    libraries.</para>
 
     <para><command>install -v -m644 examples/LDAP/* 
/etc/openldap/schema</command>:
     These commands are used to copy sample Samba schemas to the OpenLDAP
@@ -406,13 +416,12 @@
 
       </sect4>
 
-      <sect4 id="samba-init">
+      <sect4 id="samba-init" revision="sysv">
         <title>Boot Script</title>
 
         <para>For your convenience, boot scripts have been provided for
         <application>Samba</application>. There are two included in the
-        <xref linkend="bootscripts" revision="sysv"/>
-        <xref linkend="systemd-units" revision="systemd"/> package. The first,
+        <xref linkend="bootscripts"/> package. The first,
         <filename>samba</filename>, will start the <command>smbd</command>
         and <command>nmbd</command> daemons needed to provide SMB/CIFS
         services. The second script, <filename>winbind</filename>, starts
@@ -452,7 +461,69 @@
 
 <screen role="root"><userinput>make install-winbindd</userinput></screen>
 
-       </sect4>
+      </sect4>
+
+      <sect4 id="samba-init-sysd" revision="systemd">
+        <title>Systemd Units</title>
+
+        <para>The default <application>Samba</application> installation uses 
the
+        <systemitem class='username'>nobody</systemitem> user for guest access
+        to the server. This can be overridden by setting the
+        <option>guest account =</option> parameter in the
+        <filename>/etc/samba/smb.conf</filename> file. If you utilize the
+        <option>guest account =</option> parameter, ensure this user exists in
+        the <filename>/etc/passwd</filename> file.</para>
+
+        <para>
+          To start the <application>Samba</application> daemons at boot,
+          install the systemd units from the <xref linkend="systemd-units"/>
+          package by running the following command as the
+          <systemitem class="username">root</systemitem> user:
+        </para>
+
+        <indexterm zone="samba samba-init-sysd">
+          <primary sortas="f-samba">samba</primary>
+        </indexterm>
+
+<screen role="root"><userinput>make install-samba</userinput></screen>
+
+        <para>
+          To start the <command>winbindd</command> daemon at boot,
+          install the systemd unit from the <xref linkend="systemd-units"/>
+          package by running the following command as the
+          <systemitem class="username">root</systemitem> user:
+        </para>
+
+        <indexterm zone="samba samba-init-sysd">
+          <primary sortas="f-winbindd">winbindd</primary>
+        </indexterm>
+
+<screen role="root"><userinput>make install-winbindd</userinput></screen>
+
+        <note>
+        <para>This package comes with two types of units: A service file and a
+        socket file. The service file will start the smbd daemon once at boot
+        and it will keep running until the system shuts down. The socket file
+        will make systemd listen on the smbd port (Default 445, needs to be
+        edited for anything else) and will start the smbd daemon when something
+        tries to connect to that port and stop the daemon when the connection
+        is terminated. This is called socket activation and is analogous to
+        using <application>{,x}inetd</application> on a SysVinit based
+        system.</para>
+
+        <para>By default, the first method is used - the smbd daemon is started
+        at boot and stopped at shutdown. If the socket method is desired, you
+        need to run the following commands as the
+        <systemitem class="username">root</systemitem> user:</para>
+
+<screen role="root"><userinput>systemctl stop smbd &amp;&amp;
+systemctl disable smbd &amp;&amp;
+systemctl enable smbd.socket &amp;&amp;
+systemctl start smbd.socket</userinput></screen>
+
+        <para>Note that only the smbd daemon can be socket activated.</para>
+        </note>
+      </sect4>
 
     </sect3>
 

Modified: trunk/BOOK/networking/netprogs/wpa_supplicant.xml
==============================================================================
--- trunk/BOOK/networking/netprogs/wpa_supplicant.xml   Fri Jun 10 14:58:35 
2016        (r17477)
+++ trunk/BOOK/networking/netprogs/wpa_supplicant.xml   Fri Jun 10 22:26:20 
2016        (r17478)
@@ -214,6 +214,14 @@
 install -v -m644 doc/docbook/wpa_supplicant.conf.5 /usr/share/man/man5/ 
&amp;&amp;
 install -v -m644 doc/docbook/wpa_{cli,passphrase,supplicant}.8 
/usr/share/man/man8/</userinput></screen>
 
+    <para revision="systemd">
+      Install the <application>systemd</application> support files by
+      running the following command as the <systemitem
+      class="username">root</systemitem> user:
+    </para>
+
+<screen role="root" revision="systemd"><userinput>install -v -m644 
systemd/*.service /lib/systemd/system/</userinput></screen>
+
     <para>
       If you have built <application>WPA Supplicant</application> with
       <application>D-Bus</application> support, you will need to install
@@ -227,6 +235,17 @@
 install -v -m644 dbus/dbus-wpa_supplicant.conf \
                  /etc/dbus-1/system.d/wpa_supplicant.conf</userinput></screen>
 
+    <para revision="systemd">
+      Additionally, enable the <filename>wpa_supplicant.service</filename>
+      so that <application>systemd</application> can properly activate the
+      <application>D-Bus</application> service. Note that the 
+      per-connection service and the D-Bus service cannot be enabled 
+      at the same time. Run the following command as the
+      <systemitem class="username">root</systemitem> user:
+    </para>
+
+<screen role="root" revision="systemd"><userinput>systemctl enable 
wpa_supplicant</userinput></screen>
+
     <para>
       If you have built the <application>WPA Supplicant</application> GUI
       program, install it by running the following commands as the
@@ -257,15 +276,24 @@
     <sect3 id="wpa_supplicant-config">
       <title>Config File</title>
 
-      <para>
+      <para revision="sysv">
         <filename>/etc/sysconfig/wpa_supplicant-*.conf</filename>
       </para>
 
-      <indexterm zone="wpa_supplicant wpa_supplicant-config">
+      <para revision="systemd">
+        <filename>/etc/wpa_supplicant/wpa_supplicant-*.conf</filename>
+      </para>
+
+      <indexterm zone="wpa_supplicant wpa_supplicant-config" revision="sysv">
         <primary
         
sortas="e-etc-sysconfig-wpa_supplicant-star.conf">/etc/sysconfig/wpa_supplicant-*.conf</primary>
       </indexterm>
 
+      <indexterm zone="wpa_supplicant wpa_supplicant-config" 
revision="systemd">
+        <primary
+        
sortas="e-etc-wpa_supplicant-wpa_supplicant-star.conf">/etc/wpa_supplicant/wpa_supplicant-*.conf</primary>
+      </indexterm>
+
     </sect3>
 
     <sect3>
@@ -273,26 +301,34 @@
 
       <para>
         To connect to an access point that uses a password, you need to put
-        the pre-shared key in <filename>
-        
/etc/sysconfig/wpa_supplicant-<replaceable>wifi0</replaceable>.conf</filename>.
+        the pre-shared key in
+        <phrase revision="sysv"><filename>
+        
/etc/sysconfig/wpa_supplicant-<replaceable>wifi0</replaceable>.conf</filename>.</phrase>
+        <phrase revision="systemd"><filename>
+        
/etc/wpa_supplicant/wpa_supplicant-<replaceable>wifi0</replaceable>.conf</filename>.</phrase>
         SSID is the string that the access point/router transmits to
         identify itself. Run the following command as the
         <systemitem class="username">root</systemitem> user:
       </para>
 
-<screen role="root"><userinput>wpa_passphrase <replaceable>SSID</replaceable> 
<replaceable>SECRET_PASSWORD</replaceable> &gt; 
/etc/sysconfig/wpa_supplicant-<replaceable>wifi0</replaceable>.conf</userinput></screen>
+<screen role="root" revision="sysv"><userinput>wpa_passphrase 
<replaceable>SSID</replaceable> <replaceable>SECRET_PASSWORD</replaceable> &gt; 
/etc/sysconfig/wpa_supplicant-<replaceable>wifi0</replaceable>.conf</userinput></screen>
+
+<screen role="root" revision="systemd"><userinput>install -v -dm755 
/etc/wpa_supplicant &amp;&amp;
+wpa_passphrase <replaceable>SSID</replaceable> 
<replaceable>SECRET_PASSWORD</replaceable> &gt; 
/etc/wpa_supplicant/wpa_supplicant-<replaceable>wifi0</replaceable>.conf</userinput></screen>
 
       <para>
-        
<filename>/etc/sysconfig/wpa_supplicant-<replaceable>wifi0</replaceable>.conf
-        </filename> can hold the details of several access points. When
+        <phrase 
revision="sysv"><filename>/etc/sysconfig/wpa_supplicant-<replaceable>wifi0</replaceable>.conf
 </filename></phrase>
+        <phrase 
revision="systemd"><filename>/etc/sysconfig/wpa_supplicant-<replaceable>wifi0</replaceable>.conf</filename></phrase>
 
+        can hold the details of several access points. When
         <command>wpa_supplicant</command> is started, it will scan for the
         SSIDs it can see and choose the appropriate password to connect.
         </para>
 
       <para>
         If you want to connect to an access point that isn't password
-        protected, put an entry like this in <filename>
-        
/etc/sysconfig/wpa_supplicant-<replaceable>wifi0</replaceable>.conf</filename>.
+        protected, put an entry like this in
+        <phrase 
revision="sysv"><filename>/etc/sysconfig/wpa_supplicant-<replaceable>wifi0</replaceable>.conf</filename></phrase>
+        <phrase 
revision="systemd"><filename>/etc/sysconfig/wpa_supplicant-<replaceable>wifi0</replaceable>.conf</filename></phrase>.
         Replace "Some-SSID" with the SSID of the access point/router.
       </para>
 
@@ -313,21 +349,20 @@
     <sect3>
       <title>Connecting to an Access Point</title>
 
-      <para id="wpa-service">
+      <para id="wpa-service" revision="sysv">
         If you want to configure network interfaces at boot using
         <command>wpa_supplicant</command>, you need to install the
         <filename>/lib/services/wpa</filename> script
-        included in <xref linkend="bootscripts" revision="sysv"/>
-        <xref linkend="systemd-units" revision="systemd"/> package:
+        included in <xref linkend="bootscripts"/> package:
       </para>
 
-<screen role="root"><userinput>make install-service-wpa</userinput></screen>
+<screen role="root" revision="sysv"><userinput>make 
install-service-wpa</userinput></screen>
 
-      <indexterm zone="wpa_supplicant wpa-service">
+      <indexterm zone="wpa_supplicant wpa-service" revision="sysv">
         <primary sortas="f-wpa">wpa</primary>
       </indexterm>
 
-      <para>
+      <para revision="sysv">
         If your router/access point uses DHCP to allocate IP addresses, you
         can install <xref linkend="dhcp"/> client and use it to
         automatically obtain network addresses. Create the
@@ -336,7 +371,7 @@
         <systemitem class="username">root</systemitem> user:
       </para>
 
-<screen role="root"><userinput>cat &gt; 
/etc/sysconfig/ifconfig.<replaceable>wifi0</replaceable> &lt;&lt; "EOF"
+<screen role="root" revision="sysv"><userinput>cat &gt; 
/etc/sysconfig/ifconfig.<replaceable>wifi0</replaceable> &lt;&lt; "EOF"
 <literal>ONBOOT="yes"
 IFACE="<replaceable>wlan0</replaceable>"
 SERVICE="wpa"
@@ -357,7 +392,7 @@
 PRINTALL="no"</literal>
 EOF</userinput></screen>
 
-      <para>
+      <para revision="sysv">
         If you prefer <xref linkend="dhcpcd"/> instead of
         <xref linkend="dhcp"/> client, then create the
         <filename>/etc/sysconfig/ifconfig-<replaceable>wifi0</replaceable>
@@ -365,7 +400,7 @@
         <systemitem class="username">root</systemitem> user:
       </para>
 
-<screen role="root"><userinput>cat &gt; 
/etc/sysconfig/ifconfig.<replaceable>wifi0</replaceable> &lt;&lt; "EOF"
+<screen role="root" revision="sysv"><userinput>cat &gt; 
/etc/sysconfig/ifconfig.<replaceable>wifi0</replaceable> &lt;&lt; "EOF"
 <literal>ONBOOT="yes"
 IFACE="<replaceable>wlan0</replaceable>"
 SERVICE="wpa"
@@ -378,7 +413,7 @@
 DHCP_STOP="-k <replaceable>&lt;insert additional stop options 
here&gt;</replaceable>"</literal>
 EOF</userinput></screen>
 
-      <para>
+      <para revision="sysv">
         Alternatively, if you use static addresses on your local network,
         then create the
         <filename>/etc/sysconfig/ifconfig-<replaceable>wifi0</replaceable>
@@ -386,7 +421,7 @@
         <systemitem class="username">root</systemitem> user:
       </para>
 
-<screen role="root"><userinput>cat &gt; 
/etc/sysconfig/ifconfig.<replaceable>wifi0</replaceable> &lt;&lt; "EOF"
+<screen role="root" revision="sysv"><userinput>cat &gt; 
/etc/sysconfig/ifconfig.<replaceable>wifi0</replaceable> &lt;&lt; "EOF"
 <literal>ONBOOT="yes"
 IFACE="<replaceable>wlan0</replaceable>"
 SERVICE="wpa"
@@ -401,15 +436,45 @@
 BROADCAST="192.168.1.255"</literal>
 EOF</userinput></screen>
 
+      <para revision="systemd">
+        There are 3 types of <application>systemd</application> units
+        that were installed:
+      </para>
+
+      <itemizedlist spacing="compact" revision="systemd">
+        <listitem>
+          <para>
+            wpa_supplicant@.service
+          </para>
+        </listitem>
+        <listitem>
+          <para>
+            wpa_supplicant-nl80211@.service
+          </para>
+        </listitem>
+        <listitem>
+          <para>
+            wpa_supplicant-wired@.service
+          </para>
+        </listitem>
+      </itemizedlist>
+
+      <para revision="systemd">
+        The only difference between 3 of them is what driver
+        is used for connecting (-D option). The first one uses
+        the default driver, the second one uses the nl80211
+        driver and the third one uses the wired driver.
+      </para>
+
       <para>
         You can connect to the wireless access point by
         running the following command as the
         <systemitem class="username">root</systemitem> user:
       </para>
 
-<screen role="root"><userinput>ifup 
<replaceable>wifi0</replaceable></userinput></screen>
+<screen role="root" revision="sysv"><userinput>ifup 
<replaceable>wifi0</replaceable></userinput></screen>
 
-      <para>
+      <para revision="sysv">
         Replace <replaceable>wlan0</replaceable> with the correct
         wireless interface and <replaceable>wifi0</replaceable>
         with desired name for the configuration file. Please note
@@ -419,6 +484,30 @@
         <replaceable>wifi0</replaceable> in their name.
       </para>
 
+<screen role="root" revision="systemd"><userinput>systemctl start 
wpa_supplicant@<replaceable>wlan0</replaceable></userinput></screen>
+
+      <para revision="systemd">
+        To connect to the wireless access point at
+        boot, simply enable the appropriate
+        <command>wpa_supplicant</command> service
+        by running the following command as the
+        <systemitem class="username">root</systemitem> user:
+      </para>
+
+<screen role="root" revision="systemd"><userinput>systemctl enable 
wpa_supplicant@<replaceable>wlan0</replaceable></userinput></screen>
+
+      <para revision="systemd">
+        Depending on your setup, you can replace the
+        <filename>wpa_supplicant@.service</filename>
+        with any other listed above.
+      </para>
+
+      <para revision="systemd">
+        To assign a network address to your wireless interface, consult the
+        <ulink url="&lfs-root;/chapter07/network.html">General Network 
Configuration</ulink>
+        page in LFS.
+      </para>
+
     </sect3>
 
   </sect2>
-- 
http://lists.linuxfromscratch.org/listinfo/blfs-book
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page

Reply via email to