๐”– Scriptorium
โœฆ   LIBER   โœฆ

๐Ÿ“

Linux Service Management Made Easy with systemd: Advanced techniques to effectively manage, control, and monitor Linux systems and services

โœ Scribed by Donald A. Tevault


Publisher
Packt Publishing
Year
2022
Tongue
English
Leaves
420
Category
Library

โฌ‡  Acquire This Volume

No coin nor oath required. For personal study only.

โœฆ Synopsis


A comprehensive guide for teaching system administrators, developers, and security professionals how to create their own systemd units and maintain system security

Key Features

  • Get well-versed with maintaining and troubleshooting systemd services
  • Learn to create, modify, and reload service files and use systemd utilities
  • Use cgroups to control resource usage and enhance security

Book Description

systemd is a new type of Linux init system for today's high-performance, multi-CPU, and multi-core hardware that is now used on all major enterprise-grade Linux distros. The main goal of this Linux systemd book is to help you get an in-depth understanding of systemd to set up your servers securely and efficiently.

This book starts by explaining systemd management, which will help you manage your servers effectively. You'll then learn how to edit and create your own systemd units, which will be particularly helpful if you need to create custom services or timers and add features or security to an existing service. Next, you'll understand how to analyze and fix boot-up challenges and set system parameters. Later, you'll come across cgroups, that'll help you control system resource usage for both processes and users. The book also shows you how cgroups are structured, the differences between cgroups Version 1 and 2, and how to set resource limits on both. Finally, you'll learn about the systemd way of performing time-keeping, networking, logging, and login management. You'll discover how to configure servers accurately and gather system information to analyze system security and performance.

By the end of this Linux book, you'll be able to efficiently manage all aspects of a server running the systemd init system.

What you will learn

  • Use basic systemd utilities to manage a system
  • Create and edit your own systemd units
  • Create services for Podman-Docker containers
  • Enhance system security by adding security-related parameters
  • Find important information with journald
  • Analyze boot-up problems
  • Configure system settings with systemd utilities

Who this book is for

This book is for Linux administrators who want to learn more about maintaining and troubleshooting Linux servers. Aspiring administrators studying for a Linux certification exam and developers looking to learn how to create systemd unit files will also find this book useful. Additionally, this book will be helpful for security administrators who want to understand the security settings that can be used in systemd units and how to control resource usage with cgroups. Working knowledge of basic Linux commands is assumed.

Table of Contents

  1. Understanding the Need for systemd
  2. Understanding systemd Directories and Files
  3. Understanding Service, Path, and Socket Units
  4. Controlling systemd Services
  5. Creating and Editing Services
  6. Understanding systemd Targets
  7. Understanding systemd Timers
  8. Understanding the systemd Boot Process
  9. Setting System Parameters
  10. Understanding Shutdown and Reboot Commands
  11. Understanding cgroups Version 1
  12. Controlling Resource Usage with cgroups Version 1
  13. Understanding cgroup Version 2
  14. Using journald
  15. Using systemd-networkd and systemd-resolved
  16. Understanding Timekeeping with systemd
  17. Understanding systemd and Bootloaders
  18. Understanding systemd-logind

โœฆ Table of Contents


Cover
Copyright
Contributors
Table of Contents
Preface
Section 1: Using systemd
Chapter 1: Understanding the Need for systemd
Technical requirements
The history of Linux init systems
The shortcomings of SysV Init and upstart
The advantages of systemd
systemd's simplicity
systemd's consistency
systemd's performance
systemd security
The systemd controversy
Summary
Questions
Answers
Further reading
Chapter 2: Understanding systemd Directories and Files
Technical requirements
Understanding the systemd configuration files
Understanding the systemd unit files
Types of unit files
Understanding the systemd executables
Summary
Questions
Answers
Further reading
Chapter 3: Understanding Service, Path, and Socket Units
Technical requirements
Understanding service units
Understanding the Apache service file
Understanding the Secure Shell service file
Understanding the timesyncd service file
Understanding socket units
Understanding path units
Summary
Questions
Answers
Further reading
Chapter 4: Controlling systemd Services
Technical requirements
Verifying the status of a service
Starting, stopping, and reloading services
Enabling and disabling services
Killing a service
Masking a service
Summary
Questions
Answers
Further reading
Chapter 5: Creating and Editing Services
Technical requirements
Editing an existing service
Creating a partial edit to the [Install] section
Creating a partial edit to the [Service] section
Creating a full edit
Creating a new service
Changing the default systemd editor
Creating a new container service with podman
Summary
Questions
Answers
Further reading
Chapter 6: Understanding systemd Targets
Technical requirements
Understanding the purpose of systemd targets
Understanding the structure of a target file
Understanding the sockets.target file
Understanding dependencies in the sshd.service file
Comparing systemd targets to SysVinit runlevels
Understanding target dependencies
Changing the default target
Temporarily changing the target
Summary
Questions
Answers
Further reading
Chapter 7: Understanding systemd Timers
Technical requirements
Comparing systemd timers with cron
Viewing timer information
Understanding timer options
Understanding monotonic timers
Understanding real-time timers
Understanding calendar events for real-time timers
Creating timers
Creating a system-level timer
Creating a user-level timer
Summary
Questions
Answers
Further reading
Chapter 8: Understanding the systemd Boot Process
Technical requirements
Comparing SysV bootup and systemd bootup
Understanding SysV and systemd bootup similarities
Understanding the SysV bootup process
Understanding the systemd bootup process
Analyzing bootup performance
Some differences on Ubuntu Server 20.04
Understanding systemd generators
Understanding mount units
Understanding backward compatibility
Summary
Questions
Answers
Further reading
Chapter 9: Setting System Parameters
Technical requirements
Setting the locale parameter
Understanding the locale
Changing the default locale on the Alma machine
Changing the default locale on Ubuntu
Setting time and timezone parameters
Setting the hostname and machine information
Viewing the information
Setting the information
Summary
Questions
Answers
Further reading
Chapter 10: Understanding Shutdown and Reboot Commands
Technical requirements
Shutting down with systemctl
Halting with systemctl
Rebooting with systemctl
Using shutdown instead of systemctl
Running a job before shutting down
Summary
Questions
Answers
Further reading
Section 2: Understanding cgroups
Chapter 11: Understanding cgroups Version 1
Technical requirements
Understanding the history of cgroups
Understanding the purpose of cgroups
Understanding the structure of cgroups Version 1
Understanding the cgroup filesystem
Summary
Questions
Answers
Further reading
Chapter 12: Controlling Resource Usage with cgroups Version 1
Technical requirements
Understanding resource controllers
Examining the resource controllers
Preparing for the demos
Controlling CPU usage
Controlling Vicky's CPU usage
Controlling CPU usage for a service
Controlling memory usage
Controlling blkio usage
Setting a blkio limit for Vicky
Setting a blkio limit for a service
Understanding pam_limits and ulimit
The ulimit command
The pam_limits module
Summary
Questions
Answers
Further reading
Chapter 13: Understanding cgroup Version 2
Technical requirements
Understanding the need for Version 2
Version 1 complexity
Version 1 attribute filenames
No support for rootless containers
Understanding the improvements in cgroup Version 2
Setting resource limits on rootless containers
Understanding cpuset
Converting RHEL 8-type distros to cgroup version 2
Summary
Questions
Answers
Further reading
Section 3: Logging, Timekeeping, Networking, and Booting
Chapter 14: Using journald
Technical requirements
Understanding the pros and cons of rsyslog
Understanding the pros and cons of journald
Understanding journald on Ubuntu
Understanding journald on RHEL-type systems
Using journalctl
Searching for and viewing log data with journalctl
Sealing journald log files for security
Setting up remote logging with journald
Summary
Questions
Answers
Further reading
Chapter 15: Using systemd-networkd and systemd-resolved
Technical requirements
Understanding networkd and resolved
Understanding Netplan on Ubuntu
Viewing installer-generated Netplan configurations
Creating Netplan configurations
Understanding networkd and resolved on RHEL-type machines
Using networkctl and resolvectl
Viewing the networkd and resolved unit files
Summary
Questions
Answers
Further reading
Chapter 16: Understanding Timekeeping with systemd
Technical requirements
Understanding the importance of accurate time
Comparing NTP implementations
Understanding chrony on the AlmaLinux machine
The chronyd.service file
The chrony.conf file
Setting up a chronyd time server
Using chronyc
Understanding systemd-timesyncd
The systemd-timesyncd.service file
The timesyncd.conf file
Using timedatectl
Configuring Ubuntu to use chrony
Understanding the Precision Time Protocol
An overview of PTP
Installing PTP
Configuring PTP with software timestamping on AlmaLinux
Configuring PTP with hardware timestamping on AlmaLinux
Configuring PTP with software timestamping on Ubuntu
Configuring PTP with hardware timestamping on Ubuntu
Summary
Questions
Answers
Further reading
Chapter 17: Understanding systemd and Bootloaders
Technical requirements
Understanding the basic computer architecture
Understanding GRUB2
Comparing GRUB2 on BIOS and EFI/UEFI systems
GRUB2 on BIOS-based and EFI/UEFI-based Ubuntu machines
Understanding systemd-boot
Understanding Secure Boot
Summary
Questions
Answers
Further reading
Chapter 18: Understanding systemd-logind
Technical requirements
Understanding the need for a new login service
Understanding systemd-logind.service
The Alma Linux systemd-logind.service file
The Ubuntu Server systemd-logind.service file
Understanding logind.conf
Virtual terminals
Keeping user processes going after logout
Power management directives
The IdleAction directives
Understanding loginctl
Understanding polkit
Summary
Questions
Answers
Further reading
Index
Other Books You May Enjoy


๐Ÿ“œ SIMILAR VOLUMES


Linux Service Management Made Easy with
โœ Donald A. Tevault ๐Ÿ“‚ Library ๐Ÿ“… 2022 ๐Ÿ› Packt Publishing ๐ŸŒ English

<span><p><b>A comprehensive guide for teaching system administrators, developers, and security professionals how to create their own systemd units and maintain system security</b></p><h4>Key Features</h4><ul><li>Get well-versed with maintaining and troubleshooting systemd services</li><li>Learn to c

Ultimate Linux Network Security for Ente
โœ Adarsh Kant ๐Ÿ“‚ Library ๐Ÿ“… 2024 ๐Ÿ› Orange Education Pvt Ltd ๐ŸŒ English

<span>"Level Up Your Security Skills with Linux Expertise!"</span><span><br><br></span><span>Book Description</span><span><br>The </span><span>Ultimate Linux Network Security for Enterprises</span><span> is your essential companion to mastering advanced cybersecurity techniques tailored for Linux sy

Ultimate Linux Network Security for Ente
โœ Adarsh Kant ๐Ÿ“‚ Library ๐Ÿ“… 2024 ๐Ÿ› Orange Education Pvt Ltd ๐ŸŒ English

<span>"Level Up Your Security Skills with Linux Expertise!"</span><span><br><br></span><span>Book Description</span><span><br>The </span><span>Ultimate Linux Network Security for Enterprises</span><span> is your essential companion to mastering advanced cybersecurity techniques tailored for Linux sy

Managing Linux Systems with Webmin: Syst
โœ Jamie Cameron ๐Ÿ“‚ Library ๐Ÿ“… 2003 ๐Ÿ› Prentice Hall ๐ŸŒ English

I really like Webmin and use it often since I'm not a Linux geek. There is good information in the book and it is well edited and presented. The problem is, the book describes an outdated version of Webmin. The program has a completely new interface which is sufficiently different to make this book

Managing Linux Systems with Webmin: Syst
โœ Jamie Cameron ๐Ÿ“‚ Library ๐Ÿ“… 2003 ๐ŸŒ English

Written by the creator of Webmin, this book explains how to use the most popular Webmin modules to perform common administration tasks on a Linux system such as adding users, configuring Apache, setting up NFS file sharing and managing the Sendmail mail server.Each chapter covers a single server or