<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
  "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
  <!ENTITY % general-entities SYSTEM "../../general.ent">
  %general-entities;
]>
<sect1 id="ch-system-systemd" role="wrap">
  <?dbhtml filename="systemd.html"?>

  <title>Systemd-&systemd-version;</title>

  <indexterm zone="ch-system-systemd">
    <primary sortas="a-systemd">Systemd</primary>
  </indexterm>

  <sect2 role="package">
    <title/>

    <para>The Systemd package is a system and service manager for Linux
    operating systems.</para>

  </sect2>

  <sect2 role="installation">
    <title>Installation of systemd</title>

    <para os="a">Prepare Systemd for compilation:</para>

<screen os="b"><userinput>./configure --prefix=/usr \
    --sysconfdir=/etc --localstatedir=/var \
    --libexecdir=/usr/lib --docdir=/usr/share/doc/systemd-&systemd-version; \
    --with-rootprefix="" --with-rootlibdir=/lib \
    --enable-split-usr --disable-gudev</userinput></screen>

    <para os="c">Compile the package:</para>

<screen os="d"><userinput>make</userinput></screen>

    <para os="e">Install the package:</para>

<screen os="f"><userinput>make install</userinput></screen>

    <para os="g">Install man pages and documentation files that are not
    installed by default:</para>

<screen os="h"><userinput>for section in 1 3 5 7 8
do
  install -v -m644 man/*.${section} /usr/share/man/man${section}
done
install -v -m644 man/*.html /usr/share/doc/systemd-&systemd-version;</userinput></screen>

    <para os="i">Create symlinks for backwards-compatibility with Sysvinit:</para>

<screen os="j"><userinput>for tool in runlevel reboot shutdown poweroff halt telinit; do
  ln -sfv ../bin/systemctl /sbin/$tool
done
ln -sfv ../lib/systemd/systemd /sbin/init</userinput></screen>

    <para os="k">Modify a configuration file which references a group that
    doesn't exist:</para>

<screen os="l"><userinput>sed -i "s@root lock@0root root@g" /usr/lib/tmpfiles.d/legacy.conf</userinput></screen>

  </sect2>

  <sect2 id="conf-systemd" role="configuration">
    <title>Configuring Systemd</title>

    <indexterm zone="conf-systemd">
      <primary sortas="a-systemd">systemd</primary>
    <secondary>configuring</secondary></indexterm>

    <indexterm zone="conf-systemd">
      <primary sortas="e-/etc/os-release">/etc/os-release</primary>
    </indexterm>

    <para>Create <filename>/etc/machine-id</filename> which is needed
    by Journald:</para>

<screen><userinput>systemd-machine-id-setup</userinput></screen>

    <para>Create a file to identify the operating system.
    <command>systemd</command> will use this file on boot to put information
    on the screen.</para>

<screen><userinput>cat &gt; /etc/os-release &lt;&lt; "EOF"
# Begin /etc/os-release

NAME=Cross-LFS
ID=clfs

PRETTY_NAME=Cross Linux From Scratch
ANSI_COLOR=0;33

VERSION=&version;
VERSION_ID=&versionid;

# End /etc/os-release
EOF</userinput></screen>

  </sect2>

  <sect2 id="contents-systemd" role="content">
    <title>Contents of Systemd</title>

    <segmentedlist>
      <segtitle>Installed programs</segtitle>
      <segtitle>Installed libraries</segtitle>
      <segtitle>Installed directories</segtitle>

      <seglistitem>
        <seg>systemctl, systemd, systemd-ask-password, systemd-cgls,
        systemd-notify, systemd-tty-ask-password-agent</seg>
        <seg>pam_systemd</seg>
        <seg>/lib/systemd, /etc/systemd, /etc/tmpfiles.d,
        /usr/share/systemd</seg>
      </seglistitem>
    </segmentedlist>

    <variablelist>
      <bridgehead renderas="sect3">Short Descriptions</bridgehead>
      <?dbfo list-presentation="list"?>
      <?dbhtml list-presentation="table"?>

      <varlistentry id="systemctl">
        <term><command>systemctl</command></term>
        <listitem>
          <para>Control the Systemd system and service manager</para>
          <indexterm zone="ch-system-systemd systemctl">
            <primary sortas="b-systemctl">systemctl</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="systemd">
        <term><command>systemd</command></term>
        <listitem>
          <para>System and service manager for Linux</para>
          <indexterm zone="ch-system-systemd systemd">
            <primary sortas="b-systemd">systemd</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="systemd-ask-password">
        <term><command>systemd-ask-password</command></term>
        <listitem>
          <para>Queries the user for a system passphrase, via the
          TTY or an UI agent.</para>
          <indexterm zone="ch-system-systemd systemd-ask-password">
            <primary sortas="b-systemd-ask-password">systemd-ask-password</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="systemd-cgls">
        <term><command>systemd-cgls</command></term>
        <listitem>
          <para>Recursively shows control group contents</para>
          <indexterm zone="ch-system-systemd systemd-cgls">
            <primary sortas="b-systemd-cgls">systemd-cgls</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="systemd-notify">
        <term><command>systemd-notify</command></term>
        <listitem>
          <para>Notify init system about start-up completion and other daemon
          status changes</para>
          <indexterm zone="ch-system-systemd systemd-notify">
            <primary sortas="b-systemd-notify">systemd-notify</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="systemd-tty-ask-password-agent">
        <term><command>systemd-tty-ask-password-agent</command></term>
        <listitem>
          <para>Process system password requests</para>
          <indexterm zone="ch-system-systemd systemd-tty-ask-password-agent">
            <primary sortas="b-systemd-tty-ask-password-agent">systemd-tty-ask-password-agent</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="pam_systemd">
        <term><filename class="libraryfile">pam_systemd</filename></term>
        <listitem>
          <para>Register user sessions in the Systemd control group
          hierarchy</para>
          <indexterm zone="ch-system-systemd pam_systemd">
            <primary sortas="c-pam_systemd">pam_systemd</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="lib-systemd">
        <term><filename class="directory">/lib/systemd</filename></term>
        <listitem>
          <para>Location of system units and configurations</para>
          <indexterm zone="ch-system-systemd lib-systemd">
            <primary sortas="e-/lib/systemd">/lib/systemd</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="etc-systemd">
        <term><filename class="directory">/etc/systemd</filename></term>
        <listitem>
          <para>Location of user units and configurations</para>
          <indexterm zone="ch-system-systemd etc-systemd">
            <primary sortas="e-/etc/systemd">/etc/systemd</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="etc-tmpfilesd">
        <term><filename class="directory">/etc/tmpfiles.d</filename></term>
        <listitem>
          <para>Configuration for creation, deletion and cleaning of temporary
          and volatile files</para>
          <indexterm zone="ch-system-systemd etc-tmpfilesd">
            <primary sortas="e-/etc/tmpfiles.d">/etc/tmpfiles.d</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="usr-share-systemd">
        <term><filename class="directory">/usr/share/systemd</filename></term>
        <listitem>
          <para>Location of session unit files</para>
          <indexterm zone="ch-system-systemd usr-share-systemd">
            <primary sortas="e-/usr/share/systemd">/usr/share/systemd</primary>
          </indexterm>
        </listitem>
      </varlistentry>

    </variablelist>

  </sect2>

</sect1>
