From c729bc928cb74e89b5f362ffbf9221951461725c Mon Sep 17 00:00:00 2001 From: Bruce Dubbs Date: Sun, 6 Apr 2014 22:36:59 +0000 Subject: Add section on systemd customization git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@10527 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689 --- chapter07/chapter07.xml | 1 + chapter07/console.xml | 97 ++++++++++++++++++++++++++++++++++++-- chapter07/network.xml | 4 +- chapter07/sysd-custom.xml | 116 ++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 212 insertions(+), 6 deletions(-) create mode 100644 chapter07/sysd-custom.xml (limited to 'chapter07') diff --git a/chapter07/chapter07.xml b/chapter07/chapter07.xml index 08c6e32b8..ae298f0b0 100644 --- a/chapter07/chapter07.xml +++ b/chapter07/chapter07.xml @@ -18,6 +18,7 @@ + diff --git a/chapter07/console.xml b/chapter07/console.xml index a865b29b6..88395d4c5 100644 --- a/chapter07/console.xml +++ b/chapter07/console.xml @@ -23,6 +23,9 @@ equivalent settings in rc.site), the console bootscript will do nothing. + + Systemd V + The console script reads the /etc/sysconfig/console file for configuration information. Decide which keymap and screen font will be used. Various @@ -227,10 +230,96 @@ EOF - The /etc/sysconfig/console file only controls the Linux text console localization. It has nothing to do with setting the - proper keyboard layout and terminal fonts in the X Window System, with ssh - sessions or with a serial console. In such situations, limitations mentioned - in the last two list items above do not apply. + The /etc/sysconfig/console file only controls + the Linux text console localization. It has nothing to do with setting + the proper keyboard layout and terminal fonts in the X Window System, with + ssh sessions or with a serial console. In such situations, limitations + mentioned in the last two list items above do not apply. + + + + Systemd + + + systemd console + configuring + + + This section discusses how to configure the + systemd-vconsole-setup system service, which configures + the virtual console font and console keymap. + + The systemd-vconsole-setup service reads the + /etc/vconsole.conf file for configuration + information. Decide which keymap and screen font will be used. Various + language-specific HOWTOs can also help with this, see . + Examine localectl list-keymaps output for a list of + valid console keymaps. Look in + /usr/share/consolefonts + directory for valid screen fonts. + + The /etc/vconsole.conf file should contain lines + of the form: VARIABLE="value". The following variables are recognized: + + + + + KEYMAP + + This variable specifies the key mapping table for the keyboard. If + unset, it defaults to us. + + + + + KEYMAP_TOGGLE + + This variable can be used to configure a second toggle keymap and + is unset by default. + + + + + FONT + + This variable specifies the font used by the virtual + console. + + + + FONT_MAP + + This variable specifies the console map to be used. + + + + + FONT_UNIMAP + + This variable specifies the unicode font map. + + + + + + An example for a German keyboard and console is given below: + +cat > /etc/vconsole.conf << "EOF" +KEYMAP=de-latin1 +FONT=Lat2-Terminus16 +EOF + + You can change KEYMAP value at runtime by using the + localectl utility: + +localectl set-keymap MAP + + Please note that localectl command can + be used only on a system booted with Systemd. + + + diff --git a/chapter07/network.xml b/chapter07/network.xml index f776aad7a..4134bb40c 100644 --- a/chapter07/network.xml +++ b/chapter07/network.xml @@ -206,12 +206,12 @@ EOF To disable a previously enabled network interface card configuration at boot, run: -systemctl disable ifupdown@eth0 +systemctl disable ifupdown@eth0 To manually start the network interface card configuration, run: -systemctl start ifupdown@eth0 +systemctl start ifupdown@eth0 Replace eth0 with the correct network interface card name as described on the beginning of this page. diff --git a/chapter07/sysd-custom.xml b/chapter07/sysd-custom.xml new file mode 100644 index 000000000..7f3d4864b --- /dev/null +++ b/chapter07/sysd-custom.xml @@ -0,0 +1,116 @@ + + + %general-entities; +]> + + + + + Systemd Customization + + + Systemd Customization + + + + Basic Configuration + + The /etc/systemd/system.conf file contains a set + of items to control basic 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 journal settings. + + + + + Disabling Screen Clearing at Boot Time + + The normal behavior for systemd is to clear the secreen at + the end of the boot sequence. If desired, this behavior may be + changed by the following: + +mkdir -p /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 -s /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/*.conf. + Files in /etc/tmpfiles.d override files with the same name in + /usr/lib/tmpfiles.d. See man tmpfiles.d + for file format details. + + + + + Adding Custom Units and Services + + A custom service can be added by creating a directory and + configuration file in /etc/systemd/system/. + For example: + +mkdir -p /etc/systemd/system/foobar.service.d + +cat > /etc/systemd/system/foobar.service.d/foobar.conf << EOF +[Service] +Restart=always +RestartSec=30 +EOF + + See the man page for systemd.unit for more information. After + creating the configuration file, run systemctl + daemon-reload and systemctl restart + foobar to activate a service or changes to a service. + + + + + Debugging the Boot Sequence + + There are several commands that can be used to help debug the systemd + boot process. Here are some examples: + + + systemctl list-units -t service [--all] + systemctl list-units -t target [--all] + systemctl show -p Wants multi-user.target + systemctl status sshd.service + + + + + -- cgit v1.2.3-54-g00ecf