Everyday Guidebooks
Cover of Linux Administration

Cybersecurity & IT

Linux Administration: Services and Boot

A Practical Guide to Startup, Service Management, Logs, and Troubleshooting

by Todd Michael

Available now

When a Linux machine fails to start cleanly or a service refuses to run, knowing where to look can save hours of guesswork. Linux Administration: Services and Boot gives you a practical path from the first stages of startup to the workloads your system needs to serve.

Learn how firmware, the bootloader, the kernel, and systemd fit together. Inspect units and dependencies, read journal logs, investigate failed services, and distinguish a symptom from its underlying cause. Guided virtual-machine labs let you practice recovery and test configuration changes without experimenting on a production host.

Each chapter connects essential concepts to commands, expected observations, and troubleshooting decisions. Review questions and hands-on scenarios help certification candidates reinforce their skills while giving working administrators a useful reference.

Whether you are preparing for an IT certification or building confidence at the command line, this focused guide makes linux administration more understandable, testable, and manageable.

Contents
  1. 1. Build a Safe Practice Environment
  2. 2. Trace the Linux Boot Path
  3. 3. Explore Bootloader and Kernel Handoffs
  4. 4. Understand systemd and Unit Files
  5. 5. Control Services with systemctl
  6. 6. Read Service State and Process Behavior
  7. 7. Make Sense of Dependencies and Ordering
  8. 8. Targets, Boot States, and Startup Timing
  9. 9. Find Evidence in the Journal
  10. 10. Diagnose Failed Units
  11. 11. Change Configuration Safely
  12. 12. Troubleshoot Boot and Recovery Problems
  13. 13. Work Through Integrated Service Scenarios
  14. Scenario 1: A Required Service Is Not Ready in Time
  15. Give the unordered consumer an opportunity to record its check.
  16. The bound also lets the ordered version eventually complete.
  17. Save the result before releasing the producer.
  18. Scenario 2: A Configuration Fix That Has Not Reached the Service
  19. Scenario 3: A Successful Preparation Task with Stale Output
  20. Carry the Method Forward
  21. 14. Review, Practice, and Build a Troubleshooting Reference
  22. Other Books by Todd Michael

Read a sample: 1. Build a Safe Practice Environment

A service-management lab becomes much more useful when you are free to make mistakes. A failed service, an incorrect dependency, or a system that will not complete startup can teach you a great deal—provided the machine is yours to repair and you have a reliable way back.

In this chapter, you will prepare a Linux virtual machine for the exercises ahead. You will verify that it uses systemd, establish administrative and console access, and create a known-good recovery point. You will also practice the shell conventions used throughout the book. By the end, you should have a small, disposable system on which you can investigate startup and services without treating your everyday computer as the test subject.

The goal is not to make every experiment risk-free. A virtual machine can still contain files you care about, reach other systems over a network, or consume resources on its host. The goal is to define a clear boundary, understand how to recover within that boundary, and keep anything valuable outside it.

The host is the physical computer running your virtualization software. The guest is the Linux system running inside the virtual machine, often shortened to VM. Commands in this book are intended for the guest unless the text explicitly says otherwise.

Use a virtualization application that supports virtual disks, an interactive display or console, and snapshots. The application may call its console a display, screen, or window. The essential feature is that you can interact with the guest even if its network connection is unavailable.

For the guest, choose a current Linux distribution that uses systemd as its service manager. A mainstream server or desktop installation is suitable. A minimal server installation keeps the environment uncluttered, while a desktop may be more comfortable if you prefer graphical tools. The labs primarily use the shell, so neither choice requires you to manage services through a graphical interface.

Download the installation image from the distribution’s official source. Follow its published instructions for checking the image when practical, especially if you obtained it through a mirror. Record the distribution name and release in your lab notes; service names, package tools, bootloader layouts, and default settings can differ between distributions.

A reasonable starting allocation is two virtual CPUs, 2 GiB of memory, and a 20 GiB virtual disk, provided your host has enough resources to run comfortably. Some desktop installers or distributions may need more. Consult the distribution’s installation guidance if the installer is slow or reports insufficient resources. The disk belongs to the lab: do not attach an existing disk that contains important data.

Create a new VM in your virtualization application and attach the Linux installation image as its virtual installation media. If the application asks you to select an operating system type, choose the closest match to your distribution and architecture.

Use a simple, clearly identifiable name such as linux-services-lab. During installation:

1. Install to the new virtual disk, not to a physical host disk or an existing shared disk. 2. Create a normal user account and choose a password you can retrieve. 3. Configure that account for administrative access if the installer offers the option. 4. Select a standard installation rather than a specialized container or appliance image. 5. Finish installation, remove or disconnect the installation media if necessary, and boot from the virtual disk.

A VM network mode using network address translation, commonly called NAT, is a practical starting point. It usually lets the guest reach package repositories without making the guest directly visible as a separate machine on your local network. Exact behavior depends on the virtualization application and host configuration, so do not treat the network mode as a complete security boundary. Avoid connecting the lab to sensitive networks, and do not add shared folders or forwarded ports unless you need them and understand the exposure.

Log in through the VM console. If the guest starts a graphical desktop, open its terminal application. On a text console, log in at the prompt. You do not need remote access for the labs in this book; keeping the console available is more important than setting up SSH.

Start by identifying the system from inside the guest:

bash cat /etc/os-release uname -r

The first command shows operating system identification information. The second prints the running kernel release. Your output will not necessarily match anyone else’s, and that is fine. These commands establish which environment you are observing; they do not change it.

Now check the process running as PID 1 and ask systemd for its version:

bash ps -p 1 -o comm= systemctl --version

On the intended lab system, the first command should normally print systemd, and the second should display version information. PID 1 is the first userspace process started by the kernel in a conventional Linux boot. Later chapters will examine how the system reaches it and how systemd brings units into operation.

A systemctl executable alone does not prove that systemd is managing the running system. It may be installed in an environment where another process is PID 1. If PID 1 is not systemd, or if systemctl cannot communicate with the manager, check that you booted the VM normally from the installed virtual disk. You may have started an installer’s temporary environment or selected an image designed for a container. Resolve that mismatch before proceeding.

You can also make a read-only query of the manager:

bash systemctl is-system-running

More Cybersecurity & IT

Cover of The White Hat Bible, Volume 1The White Hat Bible, Volume 1Available nowCover of The White Hat Bible, Volume 2The White Hat Bible, Volume 2Available nowCover of The White Hat Bible, Volume 3The White Hat Bible, Volume 3Available nowCover of The White Hat Bible, Volume 4The White Hat Bible, Volume 4Available nowThe White Hat Bible, Volume 5Available nowCover of The White Hat Pocket GuideThe White Hat Pocket GuideAvailable now

About Todd Michael

Todd Michael is an American author and the founder of ToddMichael.tv. He writes practical, plain-English books on money, health, preparedness, technology, games, humor and more.

About the author Todd Michael · Todd Michael’s author site

Part of the ToddMichael.tv network.