systemd for Linux SysAdmins All You Need to Know About the systemd Suite for Linux Users — David Both
systemd for Linux SysAdmins All You Need to Know About the systemd Suite for Linux Users David Both
systemd for Linux SysAdmins: All You Need to Know About the systemd Suite for Linux Users ISBN-13 (pbk): 979-8-8688-1327-6 ISBN-13 (electronic): 979-8-8688-1328-3 https://doi.org/10.1007/979-8-8688-1328-3 Copyright © 2025 by David Both This work is subject to copyright. All rights are reserved by the Publisher, whether the whole or part of the material is concerned, specifically the rights of translation, reprinting, reuse of illustrations, recitation, broadcasting, reproduction on microfilms or in any other physical way, and transmission or information storage and retrieval, electronic adaptation, computer software, or by similar or dissimilar methodology now known or hereafter developed. Trademarked names, logos, and images may appear in this book. Rather than use a trademark symbol with every occurrence of a trademarked name, logo, or image we use the names, logos, and images only in an editorial fashion and to the benefit of the trademark owner, with no intention of infringement of the trademark. The use in this publication of trade names, trademarks, service marks, and similar terms, even if they are not identified as such, is not to be taken as an expression of opinion as to whether or not they are subject to proprietary rights. While the advice and information in this book are believed to be true and accurate at the date of publication, neither the authors nor the editors nor the publisher can accept any legal responsibility for any errors or omissions that may be made. The publisher makes no warranty, express or implied, with respect to the material contained herein. Managing Director, Apress Media LLC: Welmoed Spahr Acquisitions Editor: James Robinson-Prior Editorial Project Manager: Jacob Shmulewitz Cover image designed by David Both Distributed to the book trade worldwide by Springer Science+Business Media New York, 1 New York Plaza, New York, NY 10004. Phone 1-800-SPRINGER, fax (201) 348-4505, e-mail orders-ny@springer-sbm.com, or visit www.springeronline.com. Apress Media, LLC is a Delaware LLC and the sole member (owner) is Springer Science + Business Media Finance Inc (SSBM Finance Inc). SSBM Finance Inc is a Delaware corporation. For information on translations, please e-mail booktranslations@springernature.com; for reprint, paperback, or audio rights, please e-mail bookpermissions@springernature.com. Apress titles may be purchased in bulk for academic, corporate, or promotional use. eBook versions and licenses are also available for most titles. For more information, reference our Print and eBook Bulk Sales web page at http://www.apress.com/bulk-sales. Any source code or other supplementary material referenced by the author in this book is available to readers on GitHub. For more detailed information, please visit https://www.apress. com/gp/services/source-code. If disposing of this product, please recycle the paper David Both Raleigh, NC, USA
(This page has no text content)
(This page has no text content)
(This page has no text content)
(This page has no text content)
(This page has no text content)
(This page has no text content)
(This page has no text content)
(This page has no text content)
(This page has no text content)
(This page has no text content)
xv David Both, SCSA, RHCT, RHCE, is an open source software and Linux advocate, trainer, writer, and speaker. He has been working with Linux and open source software since 1996 and has been working with computers for over 50 years. He is a strong proponent of and evangelist for the “Linux Philosophy for System Administrators.” He has taught RHCE classes for Red Hat and has worked at MCI Worldcom, Cisco, and the State of North Carolina. He has taught classes on Linux ranging from Lunch'n'Learns to full five-day courses. David has written articles for magazines including Linux Magazine, Linux Journal, and OS/2 Magazine back when there was such a thing. David wrote for Opensource.com (OSDC) before it was closed by Red Hat. He now writes for Both.org while working with a core group of OSDC alumni to recreate the community that made OSDC so successful. David has published eight previous books with Apress, including The Linux Philosophy for SysAdmins, August 2018; a three-volume self- study training course, Using and Administering Linux – Zero to SysAdmin, released in December 2019; and Linux for Small Business Owners, released in late 2022. The second edition of Using and Administering Linux – Zero to SysAdmin was released in 2023. He has found some interesting and unusual ways of problem-solving, including sitting on one computer on which he was working. About the Author
xvii About the Technical Reviewer Seth Kenlon is a UNIX and Linux geek, open source enthusiast, and tabletop gamer. Between gigs in the film industry and the tech industry (not necessarily exclusive of one another), he designs games and hacks on Java and Lua. Visit gopher://ada.info- underground.net:70/1/klaatu or http://seth.kenlon.com for more information.
xix First, I need to say a special thanks to my awesome wife, Alice, who has been my head cheerleader. I could not have done this without you, my best friend, my sweetie. I’d like to thank my editor, James Robinson-Prior, for seeing the need for this book. I’d also like to thank Shobana Srinivasan, Gryffin Winkler, and Jacob Shmulewitz for their efforts in making this book a reality. I’d also like to thank all the people in production—the ones who take files full of words and produce the finished book in multiple formats. You always make my words look good. Acknowledgments
xxi Introduction Explore the world of systemd, the modern but controversial replacement for init and SystemV init scripts. systemd can evoke a wide range of reactions from SysAdmins and others responsible for keeping Linux systems up and running. The fact that systemd is taking over so many system management tasks in modern Linux systems has engendered pushback and discord among some groups of developers and SysAdmins. Yet that wide reach of systemd is the very reason it’s so popular with others. This book will help you to understand systemd’s strengths and weaknesses and why there’s no truth in the myth that systemd is a monolithic monstrosity. systemd is the mother of all processes and is also responsible for bringing the Linux host up to a state in which productive work can be done. You’ll learn about the functions assumed by systemd, which is far more extensive than the old init program, and how it manages many aspects of a running Linux host, including • Mounting filesystems • Managing hardware • Creating new systemd services and understanding existing ones • Creating timers that trigger system maintenance events • Starting and managing the system services that are required to have a productive Linux host
xxii • Using the systemd journal to access critical performance and problem-solving information • Why the systemd plan to take over the world is actually a good thing This book introduces you to systemd with an overview and exploration of the controversy surrounding it. We’ll cover systemd’s major components and how they can provide insight into Linux startup, as well as how to manage the tools and services required to operate and maintain a running Linux computer. This book will help demystify systemd. You’ll learn what it is, what it does, and how to use it to keep Linux systems up and running. You’ll explore the major functional components of systemd with real-world examples to illustrate their typical usage. You’ll also learn pragmatic work- arounds, hints, and tricks to minimize the issues that systemd does have and ensure you have maximized your system’s functionality and security. You’ll learn to manage each of the major functional components of systemd and learn from real-world examples to illustrate their typical usage by SysAdmins. This book is intended for Linux system administrators (SysAdmins) who need to or are already in the process of switching from SystemV to systemd. It’s also intended for SysAdmins with more systemd experience but who want to improve their knowledge and skills with systemd. This book is not for anyone who is not a SysAdmin. If you’re only interested in getting your work done and have no interest in what’s happening under the covers, if you call upon others to fix your computer when something goes awry, this is not the book for you. InTroduCTIon
1© David Both 2025 D. Both, systemd for Linux SysAdmins, https://doi.org/10.1007/979-8-8688-1328-3_1 CHAPTER 1 Learning to Love systemd Objectives In this chapter, you will learn • To differentiate the stages of the Linux boot process • About the controversy surrounding SystemV vs. systemd • To list the functions of systemd • Why systemd is an improvement over SystemV startup and init services • How the SystemV runlevels compare to systemd targets • The functions of systemd during boot • The functions of systemd while the system is up and running • To list the dependencies of systemd targets • To prepare for the experiments that start in Chapter 2
Loading comments...
Reply to Comment
Edit Comment