source: chapter07/systemd-custom.xml@ d88e730

7.7-systemd 7.8-systemd 7.9-systemd
Last change on this file since d88e730 was d88e730, checked in by Chris Staub <chris@…>, 9 years ago

Fix misspelling. Thanks to 'unidentified-dud' on IRC for the report

git-svn-id: http://svn.linuxfromscratch.org/LFS/branches/systemd@10783 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689

  • Property mode set to 100644
File size: 4.3 KB
RevLine 
[1dff4fef]1<?xml version="1.0" encoding="ISO-8859-1"?>
2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
3 "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
4 <!ENTITY % general-entities SYSTEM "../general.ent">
5 %general-entities;
6]>
7
8<sect1 id="ch-scripts-systemd-custom">
9 <?dbhtml filename="systemd-custom.html"?>
10
11 <title>Systemd Usage and Configuration</title>
12
13 <indexterm zone="ch-scripts-systemd-custom">
14 <primary sortas="e-Systemd">Systemd Customization</primary>
15 </indexterm>
16
17 <sect2>
18 <title>Basic Configuration</title>
19
20 <para>The <filename>/etc/systemd/system.conf</filename> file contains a set
21 of options to control basic systemd operations. The default file has all
22 entries commented out with the default settings indicated. This file is
23 where the log level may be changed as well as some basic logging settings.
24 See <filename>systemd-system.conf(5)</filename> manual page for details on
25 each configuration option.</para>
26
27 </sect2>
28
29 <sect2>
30 <title>Disabling Screen Clearing at Boot Time</title>
31
[d88e730]32 <para>The normal behavior for systemd is to clear the screen at
[1dff4fef]33 the end of the boot sequence. If desired, this behavior may be
34 changed by running the following command:</para>
35
[2328343]36<screen role="nodump"><userinput>mkdir -pv /etc/systemd/system/getty@tty1.service.d
[1dff4fef]37
38cat &gt; /etc/systemd/system/getty@tty1.service.d/noclear.conf &lt;&lt; EOF
[2328343]39<literal>[Service]
40TTYVTDisallocate=no</literal>
[1dff4fef]41EOF</userinput></screen>
42
43 <para>The boot messages can always be revied by using the
44 <userinput>journalctl -b</userinput> command as the root user.</para>
45
46 </sect2>
47
48 <sect2>
49 <title>Disabling tmpfs for /tmp</title>
50
51 <para>By default, <filename class="directory">/tmp</filename> is created as
52 a tmpfs. If this is not desired, it can be overridden by the following:</para>
53
54<screen role="nodump"><userinput>ln -sfv /dev/null /etc/systemd/system/tmp.mount</userinput></screen>
55
56 <para>This is not necessary if there is a separate partition for
57 <filename class="directory">/tmp</filename> specified in
58 <filename>/etc/fstab</filename>.</para>
59
60 </sect2>
61
62 <sect2>
63 <title>Configuring Automatic File Creation and Deletion</title>
64
65 <para>There are several services that create or delete files or
66 directories:</para>
67
68 <itemizedlist>
69 <listitem><para>systemd-tmpfiles-clean.service</para></listitem>
70 <listitem><para>systemd-tmpfiles-setup-dev.service</para></listitem>
71 <listitem><para>systemd-tmpfiles-setup.service</para></listitem>
72 </itemizedlist>
73
74 <para>The system location for the configuration files is
75 <filename>/usr/lib/tmpfiles.d/*.conf</filename>. The local
76 configuration files are in
77 <filename class="directory">/etc/tmpfiles.d</filename>. Files in
78 <filename class="directory">/etc/tmpfiles.d</filename> override
79 files with the same name in
80 <filename class="directory">/usr/lib/tmpfiles.d</filename>. See
81 <filename>tmpfiles.d(5)</filename> manual page for file format
82 details.</para>
83
84 </sect2>
85
86 <sect2>
87 <title>Overriding Default Services Behavior</title>
88
89 <para>A systemd service contents can be overriden by creating a directory
90 and a configuration file in <filename
91 class="directory">/etc/systemd/system</filename>. For example:</para>
92
[2328343]93<screen role="nodump"><userinput>mkdir -pv /etc/systemd/system/foobar.service.d
[1dff4fef]94
95cat > /etc/systemd/system/foobar.service.d/foobar.conf &lt;&lt; EOF
[2328343]96<literal>[Service]
[1dff4fef]97Restart=always
[2328343]98RestartSec=30</literal>
[1dff4fef]99EOF</userinput></screen>
100
101 <para>See <filename>systemd.unit(5)</filename> manual page for more
102 information. After creating the configuration file, run
103 <userinput>systemctl daemon-reload</userinput> and <userinput>systemctl
104 restart foobar</userinput> to activate the changes to a service.</para>
105
106 </sect2>
107
108 <sect2>
109 <title>Debugging the Boot Sequence</title>
110
111 <para>There are several commands that can be used to help debug the systemd
112 boot process. Here are some examples:</para>
113
114 <itemizedlist>
115 <listitem><para>systemctl list-units -t service [--all]</para></listitem>
116 <listitem><para>systemctl list-units -t target [--all]</para></listitem>
117 <listitem><para>systemctl show -p Wants multi-user.target</para></listitem>
118 <listitem><para>systemctl status sshd.service</para></listitem>
119 </itemizedlist>
120
121 </sect2>
122
123</sect1>
Note: See TracBrowser for help on using the repository browser.