aboutsummaryrefslogtreecommitdiffstats
path: root/chapter07
diff options
context:
space:
mode:
authorBruce Dubbs <bdubbs@linuxfromscratch.org>2014-04-03 21:52:09 +0000
committerBruce Dubbs <bdubbs@linuxfromscratch.org>2014-04-03 21:52:09 +0000
commitcba2d4e6aa081fdf62e527d28eba137eb885f0cc (patch)
treeeee1c3ef6d42101635b135289262eb1386cf87a0 /chapter07
parent008436e04cb47fbba28ab083cf4ef9339699b5fd (diff)
Added systemd and dbus to the book.
Set up systemd and System V side-by-side with the ability to reboot to either system. git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@10520 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689
Diffstat (limited to 'chapter07')
-rw-r--r--chapter07/bootscripts.xml7
-rw-r--r--chapter07/chapter07.xml4
-rw-r--r--chapter07/hostname.xml10
-rw-r--r--chapter07/introduction.xml278
-rw-r--r--chapter07/network.xml61
-rw-r--r--chapter07/setclock.xml148
-rw-r--r--chapter07/site.xml4
-rw-r--r--chapter07/sysklogd.xml4
-rw-r--r--chapter07/usage.xml2
9 files changed, 376 insertions, 142 deletions
diff --git a/chapter07/bootscripts.xml b/chapter07/bootscripts.xml
index 7c2979f99..64e244d79 100644
--- a/chapter07/bootscripts.xml
+++ b/chapter07/bootscripts.xml
@@ -23,8 +23,9 @@
<sect2 role="package">
<title/>
- <para>The LFS-Bootscripts package contains a set of scripts to start/stop the
- LFS system at bootup/shutdown.</para>
+ <para>The LFS-Bootscripts package contains a set of scripts to start/stop
+ the LFS system at bootup/shutdown. The networking systemd unit file is
+ also installed.</para>
<segmentedlist>
<segtitle>&buildtime;</segtitle>
@@ -51,6 +52,7 @@
<title>Contents of LFS-Bootscripts</title>
<segmentedlist>
<segtitle>Installed scripts</segtitle>
+ <segtitle>Installed unit</segtitle>
<segtitle>Installed directories</segtitle>
<seglistitem>
@@ -58,6 +60,7 @@
ifup, localnet, modules, mountfs, mountvirtfs, network, rc, reboot,
sendsignals, setclock, ipv4-static, swap, sysctl, sysklogd, template,
udev, and udev_retry</seg>
+ <seg>ifupdown@.service</seg>
<seg>/etc/rc.d, /etc/init.d (symbolic link), /etc/sysconfig,
/lib/services, /lib/lsb (symbolic link)</seg>
</seglistitem>
diff --git a/chapter07/chapter07.xml b/chapter07/chapter07.xml
index d312ef9ad..08c6e32b8 100644
--- a/chapter07/chapter07.xml
+++ b/chapter07/chapter07.xml
@@ -9,14 +9,14 @@
<?dbhtml dir="chapter07"?>
<?dbhtml filename="chapter07.html"?>
- <title>Setting Up System Bootscripts</title>
+ <title>System Configuration and Bootscripts</title>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="introduction.xml"/>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="bootscripts.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="network.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="hosts.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="udev.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="symlinks.xml"/>
- <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="bootscripts.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="usage.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="hostname.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="setclock.xml"/>
diff --git a/chapter07/hostname.xml b/chapter07/hostname.xml
index 9addc0f2a..c508d5372 100644
--- a/chapter07/hostname.xml
+++ b/chapter07/hostname.xml
@@ -15,14 +15,14 @@
<secondary>configuring</secondary>
</indexterm>
- <para>Part of the job of the <command>localnet</command> script is setting the
- system's hostname. This needs to be configured in the
- <filename>/etc/sysconfig/network</filename> file.</para>
+ <para>Durein gthe boot process, both Systemd and System V use the same
+ file for establixhg the system's hostname.This needs to be configured by
+ creating <filename>/etc/hostname</filename>.</para>
- <para>Create the <filename>/etc/sysconfig/network</filename> file and enter a
+ <para>Create the <filename>/etc/hostname</filename> file and enter a
hostname by running:</para>
-<screen><userinput>echo "HOSTNAME=<replaceable>&lt;lfs&gt;</replaceable>" &gt; /etc/sysconfig/network</userinput></screen>
+<screen><userinput>echo "<replaceable>&lt;lfs&gt;</replaceable>" &gt; /etc/hostname</userinput></screen>
<para><replaceable>&lt;lfs&gt;</replaceable> needs to be replaced with the name given
to the computer. Do not enter the Fully Qualified Domain Name (FQDN) here. That
diff --git a/chapter07/introduction.xml b/chapter07/introduction.xml
index f05f02515..780c36a42 100644
--- a/chapter07/introduction.xml
+++ b/chapter07/introduction.xml
@@ -10,82 +10,208 @@
<title>Introduction</title>
- <para>This chapter discusses configuration files and boot scripts.
- First, the general configuration files needed to set up networking are
- presented.</para>
-
- <itemizedlist>
- <listitem>
- <para><xref linkend="ch-scripts-network" role="."/></para>
- </listitem>
- <listitem>
- <para><xref linkend="ch-scripts-hosts" role="."/></para>
- </listitem>
- </itemizedlist>
-
- <para>Second, issues that affect the proper setup of devices are
- discussed.</para>
-
- <itemizedlist>
- <listitem>
- <para><xref linkend="ch-scripts-udev" role="."/></para>
- </listitem>
- <listitem>
- <para><xref linkend="ch-scripts-symlinks" role="."/></para>
- </listitem>
- </itemizedlist>
-
- <para>The next sections detail how to install and configure the LFS system
- scripts needed during the boot process. Most of these scripts will work
- without modification, but a few require additional configuration files
- because they deal with hardware-dependent information.</para>
-
- <para>System-V style init scripts are employed in this book because they are
- widely used and relatively simple. For additional options, a hint detailing
- the BSD style init setup is available at <ulink
- url="&hints-root;bsd-init.txt"/>. Searching the LFS mailing lists for
- <quote>depinit</quote>, <quote>upstart</quote>, or <quote>systemd</quote>
- will also offer additional information.</para>
-
- <para>If using an alternative style of init scripts, skip these sections.</para>
-
- <para>A listing of the boot scripts are found in <xref linkend="scripts"
- role="."/>.</para>
-
-
- <itemizedlist>
- <listitem>
- <para><xref linkend="ch-scripts-bootscripts" role="."/></para>
- </listitem>
- <listitem>
- <para><xref linkend="ch-scripts-usage" role="."/></para>
- </listitem>
- <listitem>
- <para><xref linkend="ch-scripts-hostname" role="."/></para>
- </listitem>
- <listitem>
- <para><xref linkend="ch-scripts-setclock" role="."/></para>
- </listitem>
- <listitem>
- <para><xref linkend="ch-scripts-console" role="."/></para>
- </listitem>
- <listitem>
- <para><xref linkend="ch-scripts-sysklogd" role="."/></para>
- </listitem>
- </itemizedlist>
-
-
- <para>Finally, there is a brief introduction to the scripts and configuration
- files used when the user logs into the system.</para>
-
- <itemizedlist>
- <listitem>
- <para><xref linkend="ch-scripts-profile" role="."/></para>
- </listitem>
- <listitem>
- <para><xref linkend="ch-scripts-inputrc" role="."/></para>
- </listitem>
- </itemizedlist>
+ <para>Booting a Linux system involves several tasks. The process must
+ mount both virtual and real file systems, initialize devices, activate swap,
+ check file systems for integrity, mount any swap partitions or files, set
+ the system clock, bring up networking, start any daemons required by the
+ system, and accomplish any other custom tasks needed by the user. This
+ process must be organized to ensure the tasks are performed in the correct
+ order but, at the same time, be executed as fast as possible.</para>
+
+ <para>In the packages that were installed in Chapter 6, there were two
+ different boot systems installed. LFS provides the ability to easily
+ select which system the user wants to use and to compare and contrast the
+ two systems by actually running each system on the local computer. The
+ advantages and disadvantages of these systems is presented below.</para>
+
+ <sect2 id='sysv-desc'>
+ <title>System V</title>
+
+ <para>System V is the classic boot process that has been used in Unix and
+ Unix-like systems such as Linux since about 1983. It consists of a small
+ program, <command>init</command>, that sets up basic programs such as
+ <command>login</command> (via getty) and runs a script. This script,
+ usually named <command>rc</command>, controls the execution of a set of
+ additional scripts that perform the tasks required to initialize the
+ system.</para>
+
+ <para>The <command>init</command> program is controlled by the
+ <filename>/etc/inittab</filename> file and is organized into run levels that
+ can be run by the user:</para>
+
+ <itemizedlist>
+ <listitem><para>0 &mdash; halt</para></listitem>
+ <listitem><para>1 &mdash; Single user mode</para></listitem>
+ <listitem><para>2 &mdash; Multiuser, without networking</para></listitem>
+ <listitem><para>3 &mdash; Full multiuser mode</para></listitem>
+ <listitem><para>4 &mdash; User definable</para></listitem>
+ <listitem><para>5 &mdash; Full multiuser mode with display manager</para></listitem>
+ <listitem><para>6 &mdash; reboot</para></listitem>
+ </itemizedlist>
+
+ <para>The usual default run level is 3 or 5.</para>
+
+ <bridgehead renderas="sect3">Advantages</bridgehead>
+
+ <itemizedlist>
+ <listitem>
+ <para>Established, well understood system.</para>
+ </listitem>
+
+ <listitem>
+ <para>Easy to customize.</para>
+ </listitem>
+
+ </itemizedlist>
+
+
+ <bridgehead renderas="sect3">Disadvantages</bridgehead>
+
+ <itemizedlist>
+ <listitem>
+ <para>Slower to boot. A medium speed base LFS system
+ takes 8-12 seconds where the boot time is measured from the
+ first kernel message to the login prompt. Network
+ connectivity is typically established about 2 seconds
+ after the login prompt.</para>
+ </listitem>
+
+ <listitem>
+ <para>Serial processing of boot tasks. This is related to the previous
+ point. A delay in any process such as a file system check, will
+ delay the entire boot process.</para>
+ </listitem>
+
+ <listitem>
+ <para>Does not directly support advanced features like
+ control groups (cgroups), and per-user fair share scheduling.</para>
+ </listitem>
+
+ <listitem>
+ <para>Adding scripts requires manual, static sequencing decisions.</para>
+ </listitem>
+
+ </itemizedlist>
+
+ </sect2>
+
+ <sect2 id='sysd-desc'>
+ <title>Systemd</title>
+
+ <para>Systemd is a group of interconnected programs that handles system and
+ individual process requests. It provides a dependency system between
+ various entities called "units". It automatically addresses dependencies
+ between units and can execute several startup tasks in parallel. It
+ provides login, inetd, logging, time, and networking services. </para>
+
+ <bridgehead renderas="sect3">Advantages</bridgehead>
+
+ <itemizedlist>
+ <listitem>
+ <para>Used on many established distributions by default.</para>
+ </listitem>
+
+ <listitem>
+ <para>There is extensive documentation.
+ See <ulink url="http://www.freedesktop.org/wiki/Software/systemd/"/>.</para>
+ </listitem>
+ <listitem>
+ <para>Parallel execution of boot processes. A medium speed
+ base LFS system takes 6-10 seconds from kernel start to a
+ login prompt. Network connectivity is typically established
+ about 2 seconds after the login prompt. More complex startup
+ procedures may show a greater speedup when compared to System V.</para>
+ </listitem>
+
+ <listitem>
+ <para>Implements advanced features such as control groups to
+ manage related processes.</para>
+ </listitem>
+
+ <listitem>
+ <para>Maintains backward compatibility with System V programs
+ and scripts.</para>
+ </listitem>
+ </itemizedlist>
+
+ <bridgehead renderas="sect3">Disadvantages</bridgehead>
+
+ <itemizedlist>
+ <listitem>
+ <para>There is a substantial learning curve.</para>
+ </listitem>
+
+ <listitem>
+ <para>Some advanced features such as dbus or cgroups cannot be
+ disabled if they are not otherwise needed.</para>
+ </listitem>
+
+ <listitem>
+ <para>Although implemented as several executable programs
+ the user cannot choose to implement only the portions desired.</para>
+ </listitem>
+
+ <listitem>
+ <para>Due to the nature of using compiled programs, systemd is
+ more difficult to debug.</para>
+ </listitem>
+
+ <listitem>
+ <para>Logging is done in a binary format. Extra tools must
+ be used to process logs or additional processes must be implemented
+ to duplicate traditional logging programs.</para>
+ </listitem>
+
+ </itemizedlist>
+
+ </sect2>
+
+ <sect2 id='sysv'>
+ <title>Selecting a Boot Method</title>
+
+ <para>Selecting a boot method in LFS is relatively easy.
+ Both systems are installed side-by-side. The only task needed is to
+ ensure the files that are needed by the system have the correct names.
+ The following scripts do that.</para>
+
+<screen><userinput remap="install">cat &gt; /usr/local/sbin/set-systemd &lt;&lt; "EOF"
+#! /bin/bash
+
+ln -svfn init-systemd /sbin/init
+ln -svfn init.d-systemd /etc/init.d
+
+for tool in halt poweroff reboot runlevel shutdown telinit; do
+ ln -sfvn $(tool}-systemd /sbin/${tool}
+ ln -svfn ${tool}-systemd.8 /usr/share/man/man8/${tool}.8
+done
+
+echo "Now reboot with /sbin/reboot-sysv"
+EOF
+
+chmod 0744 /usr/local/sbin/set-systemd
+
+cat &gt; /usr/local/sbin/set-sysv &lt;&lt; "EOF"
+ln -sfvn init-sysv /sbin/init
+ln -svfn init.d-sysv /etc/init.d
+
+for tool in halt poweroff reboot runlevel shutdown telinit; do
+ ln -sfvn ${tool}-sysv /sbin/${tool}
+ ln -svfn ${tool}-sysv.8 /usr/share/man/man8/${tool}.8
+done
+
+echo "Now reboot with /sbin/reboot-systemd"
+EOF
+
+chmod 0744 /usr/local/sbin/set-sysv</userinput></screen>
+
+ <para>Now set the desired boot system. The default is System V:</para>
+
+<screen><userinput remap="install">/usr/local/sbin/set-sysv</userinput></screen>
+
+ <para>Changing the boot system can be done at any time by running the
+ appropriate script above and rebooting.</para>
+
+ </sect2>
</sect1>
diff --git a/chapter07/network.xml b/chapter07/network.xml
index 4e3dd43e0..f776aad7a 100644
--- a/chapter07/network.xml
+++ b/chapter07/network.xml
@@ -42,8 +42,12 @@
avoid this, Udev comes with a script and some rules to assign stable names
to network cards based on their MAC address.</para>
- <para>The rules were pre-generated in the build instructions for
- <application>udev (systemd)</application> in the last chapter. Inspect the
+ <para>If using the traditional network interface names such as eth0 is desired,
+ generate a custom Udev rule:</para>
+
+<screen><userinput>bash /lib/udev/init-net-rules.sh</userinput></screen>
+
+ <para> Now, inspect the
<filename>/etc/udev/rules.d/70-persistent-net.rules</filename> file, to
find out which name was assigned to which network device:</para>
@@ -122,11 +126,20 @@
depends on the files in <filename
class="directory">/etc/sysconfig/</filename>. This directory should
contain a file for each interface to be configured, such as
- <filename>ifconfig.xyz</filename>, where <quote>xyz</quote> is
- meaningful to the administrator such as the device name (e.g. eth0).
- Inside this file are attributes to this interface, such as its IP
- address(es), subnet masks, and so forth. It is necessary that
- the stem of the filename be <emphasis>ifconfig</emphasis>.</para>
+ <filename>ifconfig.xyz</filename>, where <quote>xyz</quote> is required to
+ be a Network Card Interface name (e.g. eth0). Inside this file are
+ attributes to this interface, such as its IP address(es), subnet masks, and
+ so forth. It is necessary that the stem of the filename be
+ <emphasis>ifconfig</emphasis>.</para>
+
+ <note><para>If the procedure in the previous section was not used, Udev
+ will assign network card interface names based on system physical
+ characteristics such as enp2s1. If you are not sure what your interface
+ name is, you can always run <command>ip link</command> after you have
+ booted your system. Again, it is important that ifconfig.xyz is named
+ after correct network card interface name (e.g. ifconfig.enp2s1 or
+ ifconfig.eth0) or your network interface will not be initialized during
+ the boot process.</para></note>
<para>The following command creates a sample file for the
<emphasis>eth0</emphasis> device with a static IP address:</para>
@@ -136,8 +149,8 @@ cat &gt; ifconfig.eth0 &lt;&lt; "EOF"
<literal>ONBOOT=yes
IFACE=eth0
SERVICE=ipv4-static
-IP=192.168.1.1
-GATEWAY=192.168.1.2
+IP=192.168.1.2
+GATEWAY=192.168.1.1
PREFIX=24
BROADCAST=192.168.1.255</literal>
EOF</userinput></screen>
@@ -146,7 +159,7 @@ EOF</userinput></screen>
the proper setup.</para>
<para>If the <envar>ONBOOT</envar> variable is set to <quote>yes</quote> the
- network script will bring up the Network Interface Card (NIC) during
+ System V network script will bring up the Network Interface Card (NIC) during
booting of the system. If set to anything but <quote>yes</quote> the NIC
will be ignored by the network script and not be automatically brought up.
The interface can be manually started or stopped with the
@@ -181,6 +194,34 @@ EOF</userinput></screen>
</sect2>
+ <sect2 id="systemd-net-enable">
+ <title>Configuring the Network Interface Card at boot (systemd)</title>
+
+ <para>Enabling of the network interface card configuration
+ in systemd is done per interface. To enable network interface card
+ configuration at boot, run:</para>
+
+<screen><userinput>systemctl enable ifupdown@eth0</userinput></screen>
+
+ <para>To disable a previously enabled network interface
+ card configuration at boot, run:</para>
+
+<screen><userinput>systemctl disable ifupdown@eth0</userinput></screen>
+
+ <para>To manually start the network interface card configuration,
+ run:</para>
+
+<screen><userinput>systemctl start ifupdown@eth0</userinput></screen>
+
+ <para>Replace eth0 with the correct network interface card
+ name as described on the beginning of this page.</para>
+
+ <note><para>The network card can also be started or stopped
+ with the traditional <command>ifup &lt;device&gt;</command> or
+ <command>ifdown &lt;device&gt;</command> commands.</para></note>
+
+ </sect2>
+
<sect2 id="resolv.conf">
<title>Creating the /etc/resolv.conf File</title>
diff --git a/chapter07/setclock.xml b/chapter07/setclock.xml
index 1daa445ef..729c447f6 100644
--- a/chapter07/setclock.xml
+++ b/chapter07/setclock.xml
@@ -5,46 +5,53 @@
%general-entities;
]>
-<sect1 id="ch-scripts-setclock">
- <?dbhtml filename="setclock.html"?>
+<sect1 id="ch-scripts-clock">
+ <?dbhtml filename="clock.html"?>
- <title>Configuring the setclock Script</title>
+ <title>Configuring the System Clock</title>
- <indexterm zone="ch-scripts-setclock">
- <primary sortas="d-setclock">setclock</primary>
- <secondary>configuring</secondary></indexterm>
+ <para>Procedures for setting the system clock differ between systemd and
+ System V, however the separate procedures do not conflict so both
+ procedures should be accomplished to allow switching between systems.</para>
+
+ <sect2 id="ch-scripts-setclock">
+ <title>System V Clock Configuration</title>
+
+ <indexterm zone="ch-scripts-setclock">
+ <primary sortas="d-setclock">setclock</primary>
+ <secondary>configuring</secondary></indexterm>
+
+ <para>The <command>setclock</command> script reads the time from the hardware
+ clock, also known as the BIOS or the Complementary Metal Oxide Semiconductor
+ (CMOS) clock. If the hardware clock is set to UTC, this script will convert the
+ hardware clock's time to the local time using the
+ <filename>/etc/localtime</filename> file (which tells the
+ <command>hwclock</command> program which timezone the user is in). There is no
+ way to detect whether or not the hardware clock is set to UTC, so this
+ needs to be configured manually.</para>
+
+ <para>The <command>setclock</command> is run via
+ <application>udev</application> when the kernel detects the hardware
+ capability upon boot. It can also be run manually with the stop parameter to
+ store the system time to the CMOS clock.</para>
+
+ <para>If you cannot remember whether or not the hardware clock is set to UTC,
+ find out by running the <userinput>hwclock --localtime --show</userinput>
+ command. This will display what the current time is according to the hardware
+ clock. If this time matches whatever your watch says, then the hardware clock is
+ set to local time. If the output from <command>hwclock</command> is not local
+ time, chances are it is set to UTC time. Verify this by adding or subtracting
+ the proper amount of hours for the timezone to the time shown by
+ <command>hwclock</command>. For example, if you are currently in the MST
+ timezone, which is also known as GMT -0700, add seven hours to the local
+ time.</para>
+
+ <para>Change the value of the <envar>UTC</envar> variable below
+ to a value of <parameter>0</parameter> (zero) if the hardware clock
+ is <emphasis>not</emphasis> set to UTC time.</para>
- <para>The <command>setclock</command> script reads the time from the hardware
- clock, also known as the BIOS or the Complementary Metal Oxide Semiconductor
- (CMOS) clock. If the hardware clock is set to UTC, this script will convert the
- hardware clock's time to the local time using the
- <filename>/etc/localtime</filename> file (which tells the
- <command>hwclock</command> program which timezone the user is in). There is no
- way to detect whether or not the hardware clock is set to UTC, so this
- needs to be configured manually.</para>
-
- <para>The <command>setclock</command> is run via
- <application>udev</application> when the kernel detects the hardware
- capability upon boot. It can also be run manually with the stop parameter to
- store the system time to the CMOS clock.</para>
-
- <para>If you cannot remember whether or not the hardware clock is set to UTC,
- find out by running the <userinput>hwclock --localtime --show</userinput>
- command. This will display what the current time is according to the hardware
- clock. If this time matches whatever your watch says, then the hardware clock is
- set to local time. If the output from <command>hwclock</command> is not local
- time, chances are it is set to UTC time. Verify this by adding or subtracting
- the proper amount of hours for the timezone to the time shown by
- <command>hwclock</command>. For example, if you are currently in the MST
- timezone, which is also known as GMT -0700, add seven hours to the local
- time.</para>
-
- <para>Change the value of the <envar>UTC</envar> variable below
- to a value of <parameter>0</parameter> (zero) if the hardware clock
- is <emphasis>not</emphasis> set to UTC time.</para>
-
- <para>Create a new file <filename>/etc/sysconfig/clock</filename> by running
- the following:</para>
+ <para>Create a new file <filename>/etc/sysconfig/clock</filename> by running
+ the following:</para>
<screen><userinput>cat &gt; /etc/sysconfig/clock &lt;&lt; "EOF"
<literal># Begin /etc/sysconfig/clock
@@ -58,11 +65,68 @@ CLOCKPARAMS=
# End /etc/sysconfig/clock</literal>
EOF</userinput></screen>
- <para>A good hint explaining how to deal with time on LFS is available
- at <ulink url="&hints-root;time.txt"/>. It explains issues such as
- time zones, UTC, and the <envar>TZ</envar> environment variable.</para>
+ <para>A good hint explaining how to deal with time on LFS is available
+ at <ulink url="&hints-root;time.txt"/>. It explains issues such as
+ time zones, UTC, and the <envar>TZ</envar> environment variable.</para>
+
+ <note><para>The CLOCKPARAMS and UTC paramaters may be alternatively set
+ in the <filename>/etc/sysconfig/rc.site</filename> file.</para></note>
+
+ </sect2>
+
+ <sect2 id="ch-scripts-systemd-clock">
+ <title>Systemd Clock Configuration</title>
+
+ <indexterm zone="ch-scripts-clock">
+ <primary sortas="d-clock">clock</primary>
+ <secondary>configuring</secondary></indexterm>
+
+ <para>This section discusses how to configure the
+ <command>systemd-timedated</command> system service, which configures
+ system clock and timezone.</para>
+
+ <para><command>systemd-timedated</command> reads
+ <filename>/etc/adjtime</filename>, and depending on the contents of the file,
+ it sets the clock to either UTC or local time. Create the
+ <filename>/etc/adjtime</filename> file with the following contents <emphasis>if your
+ hardware clock is set to local time</emphasis>:</para>
+
+<screen role="nodump"><userinput>cat &gt; /etc/adjtime &lt;&lt; "EOF"
+<literal>0.0 0 0.0
+0
+LOCAL</literal>
+EOF</userinput></screen>
+
+ <para>If <filename>/etc/adjtime</filename> isn't present at first boot,
+ <command>systemd-timedated</command> will assume that hardware clock is
+ set to UTC and create the file using that setting.</para>
+
+ <para>You can also use the <command>timedatectl</command> utility to tell
+ <command>systemd-timedated</command> if your hardware clock is set to
+ UTC or local time:</para>
+
+<screen role="nodump"><userinput>timedatectl set-local-rtc 1</userinput></screen>
+
+ <para><command>timedatectl</command> can also be used to change system time and
+ time zone.</para>
+
+ <para>To change your current system time, issue:</para>
+
+<screen role="nodump"><userinput>timedatectl set-time YYYY:MM:DD HH:MM:SS</userinput></screen>
+
+ <para>Hardware clock will also be updated accordingly.</para>
+
+ <para>To change your current time zone, issue:</para>
+
+<screen role="nodump"><userinput>timedatectl set-timezone TIMEZONE</userinput></screen>
+
+ <para>You can get list of available time zones by running:</para>
+
+<screen role="nodump"><userinput>timedatectl list-timezones</userinput></screen>
+
+ <note><para>Please note that <command>timedatectl</command> command can
+ be used only on a system booted with Systemd.</para></note>
- <note><para>The CLOCKPARAMS and UTC paramaters may be alternatively set
- in the <filename>/etc/sysconfig/rc.site</filename> file.</para></note>
+ </sect2>
</sect1>
diff --git a/chapter07/site.xml b/chapter07/site.xml
index 374b94f32..1dd6df9a1 100644
--- a/chapter07/site.xml
+++ b/chapter07/site.xml
@@ -16,8 +16,8 @@
</indexterm>
<para>The optional <filename>/etc/sysconfig/rc.site</filename> file contains
- settings that are automatically set for each boot script. It can alternatively
- set the values specified in the <filename>hostname</filename>,
+ settings that are automatically set for each SystemV boot script. It can
+ alternatively set the values specified in the <filename>hostname</filename>,
<filename>console</filename>, and <filename>clock</filename> files in the
<filename class='directory'>/etc/sysconfig/</filename> directory. If the
associated variables are present in both these separate files and
diff --git a/chapter07/sysklogd.xml b/chapter07/sysklogd.xml
index c2d784b67..a3747478a 100644
--- a/chapter07/sysklogd.xml
+++ b/chapter07/sysklogd.xml
@@ -16,8 +16,8 @@
</indexterm>
<para>The <filename>sysklogd</filename> script invokes the
- <command>syslogd</command> program with the <parameter>-m 0</parameter>
- option. This option turns off the periodic timestamp mark that
+ <command>syslogd</command> program as a part of System V initialization. The
+ <parameter>-m 0</parameter> option turns off the periodic timestamp mark that
<command>syslogd</command> writes to the log files every 20 minutes by
default. If you want to turn on this periodic timestamp mark, edit
<filename>/etc/sysconfig/rc.site</filename> and define the variable
diff --git a/chapter07/usage.xml b/chapter07/usage.xml
index 10d48b6e8..3250cd328 100644
--- a/chapter07/usage.xml
+++ b/chapter07/usage.xml
@@ -8,7 +8,7 @@
<sect1 id="ch-scripts-usage">
<?dbhtml filename="usage.html"?>
- <title>How Do These Bootscripts Work?</title>
+ <title>How Do the System V Bootscripts Work?</title>
<indexterm zone="ch-scripts-usage">
<primary sortas="a-Bootscripts">Bootscripts</primary>