From 1118b1757d67c5e7deb4c9e4b864b00f9d8a8b0c Mon Sep 17 00:00:00 2001 From: Bruce Dubbs Date: Tue, 24 May 2016 21:24:59 +0000 Subject: Create branches/merge in svn repo fo rtesting of merged LFS books git-svn-id: http://svn.linuxfromscratch.org/LFS/branches/merge@11073 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689 --- chapter07/systemd-custom.xml | 175 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 175 insertions(+) create mode 100644 chapter07/systemd-custom.xml (limited to 'chapter07/systemd-custom.xml') diff --git a/chapter07/systemd-custom.xml b/chapter07/systemd-custom.xml new file mode 100644 index 000000000..0c8ca75b9 --- /dev/null +++ b/chapter07/systemd-custom.xml @@ -0,0 +1,175 @@ + + + %general-entities; +]> + + + + + Systemd Usage and Configuration + + + Systemd Customization + + + + Basic Configuration + + The /etc/systemd/system.conf file contains a set + of options to control basic systemd operations. The default file has all + entries commented out with the default settings indicated. This file is + where the log level may be changed as well as some basic logging settings. + See systemd-system.conf(5) manual page for details on + each configuration option. + + + + + Disabling Screen Clearing at Boot Time + + The normal behavior for systemd is to clear the screen at + the end of the boot sequence. If desired, this behavior may be + changed by running the following command: + +mkdir -pv /etc/systemd/system/getty@tty1.service.d + +cat > /etc/systemd/system/getty@tty1.service.d/noclear.conf << EOF +[Service] +TTYVTDisallocate=no +EOF + + The boot messages can always be revied by using the + journalctl -b command as the root user. + + + + + Disabling tmpfs for /tmp + + By default, /tmp is created as + a tmpfs. If this is not desired, it can be overridden by the following: + +ln -sfv /dev/null /etc/systemd/system/tmp.mount + + This is not necessary if there is a separate partition for + /tmp specified in + /etc/fstab. + + + + + Configuring Automatic File Creation and Deletion + + There are several services that create or delete files or + directories: + + + systemd-tmpfiles-clean.service + systemd-tmpfiles-setup-dev.service + systemd-tmpfiles-setup.service + + + The system location for the configuration files is + /usr/lib/tmpfiles.d/*.conf. The local + configuration files are in + /etc/tmpfiles.d. Files in + /etc/tmpfiles.d override + files with the same name in + /usr/lib/tmpfiles.d. See + tmpfiles.d(5) manual page for file format + details. + + + + + Overriding Default Services Behavior + + A systemd service contents can be overriden by creating a directory + and a configuration file in /etc/systemd/system. For example: + +mkdir -pv /etc/systemd/system/foobar.service.d + +cat > /etc/systemd/system/foobar.service.d/foobar.conf << EOF +[Service] +Restart=always +RestartSec=30 +EOF + + See systemd.unit(5) manual page for more + information. After creating the configuration file, run + systemctl daemon-reload and systemctl + restart foobar to activate the changes to a service. + + + + + Debugging the Boot Sequence + + Rather than plain shell scripts used in SysVinit or BSD style init + systems, systemd uses a unified format for different type of startup + files (or units). The command systemctl is used to + enable, disable, controll state, and obtain status of unit files. Here + are some examples of frequently used commands: + + + + systemctl list-units -t <service> [--all]: + lists loaded unit files of type service. + + + systemctl list-units -t <target> [--all]: + lists loaded unit files of type target. + + + systemctl show -p Wants <multi-user.target>: + shows all units that depend on the multi-user target. Targets are + special unit files that are anogalous to runlevels under + SysVinit. + + + systemctl status <servicename.service>: + shows the status of the servicename service. The .service extension + can be omitted if there are no other unit files with the same name, + such as .socket files (which create a listening socket that provides + similar functionality to inetd/xinetd). + + + + + + + Working with the Systemd Journal + + Logging on a system booted with systemd is handled by + systemd-journald (default), rather than a typical unix syslog daemon. + systemd-journald write log entries to a binary file format, rather than + a plain text log file. To assist with parsing the file, the command + journalctl is provided. Here are some examples of + frequently used commands: + + + + journalctl -r: shows all contents of the + journal in reverse chronological order. + + + journalctl -u UNIT: + shows the journal entries associated with the specified UNIT + file. + + + journalctl -b[=ID] -r: shows the journal + entries since last successfull boot (or for boot ID) in reverse + chronological order. + + + journalctl -f: povides functionality similar + to tail -f (follow). + + + + + -- cgit v1.2.3-54-g00ecf