Courseiva
XK0-006Chapter 7 of 16Objective 2.3

System Services and Startup

System services and the boot process are the skeleton of every Linux machine. They determine how your computer wakes up from being switched off, what programs start automatically, and how you keep everything running smoothly without rebooting every time something breaks. For the XK0-006 exam, understanding this is non-negotiable because you will be asked to manage services, troubleshoot boot failures, and modify startup behaviour—tasks a Linux administrator performs daily.

12 min read
Intermediate
Updated Jul 24, 2026
Editorial oversight: Johnson Ajibi· Security Systems Architect · MSc IT Security · IEEE Senior Member

A simple way to picture System Services and Startup

The Restaurant Kitchen Opening Analogy

A restaurant kitchen is a precise machine for preparing meals. The process of opening the kitchen each day maps directly to managing system services and the boot process. The head chef is the systemd process, the first program that starts when the Linux system boots. The chef’s opening checklist represents the bootloader (like GRUB), which loads the operating system kernel. The kitchen equipment—ovens, stoves, prep stations—are the system services: the web server (Apache), the database (MySQL), the SSH daemon that lets you log in remotely. Each piece of equipment must be checked, started in the right order, and monitored. You cannot fire up the grill before the gas line is connected, just as a network service cannot start before the networking service is ready. The kitchen’s ‘target’ state (fully operational) is analogous to a Linux runlevel or systemd target, like multi-user.target, which defines what services are running. If the dishwasher breaks (a service fails), the head chef might restart it or put it in ‘maintenance mode’ (masked or disabled). The sous chef uses ‘systemctl status’ equivalent to walking around and checking each station. This analogy sticks because everyone understands the chaos of a kitchen—service failures cause bottlenecks, just like a crashed database can bring down a web application. The structured startup sequence prevents those disasters.

How It Actually Works

Every time you press the power button on a Linux computer, a precise sequence of events begins. This is the boot process. The first thing that runs is the BIOS or UEFI (Basic Input/Output System or Unified Extensible Firmware Interface) — tiny firmware stored on the motherboard. It performs a Power-On Self-Test (POST) to check that hardware like RAM and hard drives are working. Then it looks for a bootable device (the hard disk, USB drive, or network) and hands control to the bootloader.

The bootloader, most commonly GRUB (Grand Unified Bootloader), is the first piece of real software to run. Its job is to load the Linux kernel into memory. The kernel is the core of the operating system — it manages hardware, memory, and processes. GRUB presents a menu if you have multiple kernels installed, then uncompresses the kernel and starts it.

Once the kernel is running, it initialises all the hardware it can detect using built-in drivers. It then mounts the root filesystem — that is, it makes the main filesystem (like /) accessible. At this point, the kernel starts the first user-space process: the init system. On modern Linux distributions, this is almost always systemd. systemd is process number 1 (PID 1). It never dies; if it does, the kernel panics and the system crashes.

systemd takes over from here. It reads its configuration files to determine which services to start and in what order. These services are defined in unit files. Each unit file describes a service (like a web server or database), a socket, a device, a mount point, or another resource. Services have dependencies: for example, a database service might require the network to be up first. systemd sorts these dependencies into a dependency tree and starts everything in parallel where possible, aiming to reach a target state.

A target in systemd is a group of services that bring the system to a certain operational level — similar to the old concept of runlevels. For example, graphical.target boots the system into a full desktop environment, while multi-user.target boots into a text-mode multi-user environment without a graphical interface. The default target is usually set to graphical.target on desktops or multi-user.target on servers.

Once the target is reached, the system is fully operational. But managing services continues day-to-day. You can check the status of a service with 'systemctl status servicename'. You can start ('systemctl start'), stop ('systemctl stop'), restart ('systemctl restart'), enable (make it start at boot), or disable (prevent it from starting at boot) services. The 'enable' command creates a symbolic link in the filesystem that tells systemd to start the service at boot. The 'disable' command removes that link.

If something goes wrong, you can check the logs with 'journalctl -u servicename'. The journal is systemd's logging system, which collects all system messages in one place. You can also mask a service, which makes it impossible to start even manually — useful for services you never want to run.

The boot process and service management are intimately connected. Understanding systemd's unit files, targets, and dependency resolution is essential for passing XK0-006. The exam expects you to know how to edit unit files, override settings with drop-in snippets, and troubleshoot services that fail to start because of missing dependencies or configuration errors.

Flowchart showing the Linux boot process from power-on to system operational, including systemd targets and service management.

Walk-Through

1

Power on and BIOS/UEFI

When you press the power button, the BIOS or UEFI firmware on the motherboard runs a Power-On Self-Test to check hardware like RAM and storage. It then scans boot devices to find a bootloader. This is the very start of the boot process.

2

GRUB Bootloader Loads the Kernel

The bootloader (GRUB) appears, showing a menu (or booting automatically). It loads the Linux kernel from /boot into memory, along with an initial RAM disk (initramfs) containing critical drivers. The kernel then uncompresses and begins executing.

3

Kernel Initialisation and systemd Start

The kernel initialises all detected hardware and mounts the root filesystem. It then starts the first user-space process, systemd (PID 1). systemd is the init system that manages all other processes and services.

4

systemd Activates Targets and Services

systemd reads its configuration and unit files. It identifies the default target (e.g., multi-user.target or graphical.target) and resolves all dependencies. Services are started in parallel where possible, ensuring each service has its required dependencies satisfied before it starts.

5

Target Reached and System Operational

Once all services in the target are active, the system is fully operational. The login prompt appears (text or graphical). Services like SSH, Apache, and MySQL are running. You can now use systemctl commands to manage services without rebooting.

6

Daily Service Management with systemctl

After boot, administrators use systemctl to check status ('systemctl status'), start/stop/restart services ('systemctl restart httpd'), view logs ('journalctl -u httpd'), and modify service behaviour (enable, disable, mask). These commands are central to managing system services.

What This Looks Like on the Job

Imagine you are a junior Linux administrator at a small e-commerce company. The company runs its website on a single Linux server. One Monday morning, customers start reporting that the site is down. You need to troubleshoot what happened.

First, you SSH into the server. You run 'systemctl status httpd' (or 'nginx' depending on the web server). The output shows 'inactive (dead)' — the web server is not running. You check the logs with 'journalctl -u httpd' and see an error: 'bind to port 80 failed: Address already in use'. This suggests another process is occupying port 80. You run 'netstat -tlnp' and find that Apache was started twice, but the real issue is a misconfigured virtual host file.

You stop the duplicate process, edit the configuration, and restart the service using 'systemctl restart httpd'. Then you check that the service is 'active (running)' and that the site loads. You also want to ensure this does not happen on next reboot. You run 'systemctl is-enabled httpd' and it returns 'enabled', so it will start automatically at boot. But you remember that the database server (MariaDB) failed last week because the filesystem was full. You check disk space with 'df -h', clear old logs, and verify that MariaDB is also enabled and healthy.

You might also need to adjust the boot target. If this server is headless (no monitor), running 'graphical.target' wastes resources. You can check the default target with 'systemctl get-default' and change it to 'multi-user.target' with 'systemctl set-default multi-user.target' and reboot.

Another common task is creating custom service unit files so your own script or application starts at boot. For example, if the company uses a custom inventory management app, you write a unit file, drop it in '/etc/systemd/system/', run 'systemctl daemon-reload', then enable and start it.

The exam will test you on exactly these commands and scenarios. In real life, you also encounter scenarios where a service depends on a network mount. If the network mount fails, the service hangs. You learn to add 'After' and 'Requires' directives in unit files to prevent that. These are the practical skills that make you a competent administrator.

How XK0-006 Actually Tests This

XK0-006 tests your understanding of systemd and the boot process in several distinct ways. Here is what you must know:

Exam topics include:

Identifying the stages of the boot process (BIOS/UEFI -> POST -> bootloader -> kernel -> init/systemd -> target).

Using systemctl commands: start, stop, restart, reload, enable, disable, status, is-enabled, is-active, daemon-reload, list-units, list-dependencies.

Understanding service unit files: their structure (directives like Description, ExecStart, ExecStop, Restart, Wants, Requires, After, Before) and where they are stored (/usr/lib/systemd/system for vendor defaults, /etc/systemd/system for local overrides).

Difference between targets and runlevels: multi-user.target vs graphical.target vs rescue.target vs emergency.target. How to change default target.

Analysing boot failures: kernel panic, initramfs, recovery mode. Using journalctl to find error messages.

Managing the bootloader: GRUB configuration file (/boot/grub2/grub.cfg or /etc/default/grub), regenerating the GRUB config with grub2-mkconfig.

Resetting root password from GRUB: editing kernel parameters to drop into emergency shell or single-user mode.

Troubleshooting a service that fails to start: checking logs, verifying dependencies, looking at unit file syntax.

Traps the exam sets:

They might ask 'Which command enables a service to start at boot?' Distractors often suggest 'systemctl start' (which starts it now but not on boot) or 'systemctl enable --now' (which does both, but 'enable' alone is the answer for starting at boot).

They will present scenarios where you must choose between 'restart' and 'reload'. Reload sends a signal to the service to reload configuration without stopping; restart stops and starts the service. Reload is safer for production but not all services support it.

They love testing the difference between 'disable' and 'mask'. Disable prevents the service from starting automatically but allows manual start. Mask makes it impossible to start even manually.

They might ask about 'systemctl daemon-reload' — you must run this after modifying any unit file before systemd picks up changes.

Kernel parameters: knowing how to add 'single' or '1' or 'emergency' to the kernel command line in GRUB for recovery.

They might show a unit file and ask you what 'Wants=network.target' means — it means the service prefers the network to be up but will start anyway if not. 'Requires=network.target' means it will not start until the network is active.

Memorise these exact command patterns. The exam uses real-world syntax; there is no trickery beyond that.

Key Takeaways

The Linux boot process follows this order: BIOS/UEFI -> POST -> bootloader (GRUB) -> kernel -> init (systemd) -> target state.

systemd is the modern init system that manages all services; its commands use the 'systemctl' tool.

Use 'systemctl enable servicename' to make a service start automatically at boot, and 'systemctl disable servicename' to stop it from auto-starting.

Masking a service (systemctl mask servicename) makes it impossible to start even manually, unlike disabling which only prevents auto-start.

Run 'systemctl daemon-reload' after editing any unit file so systemd recognises your changes.

To change the system's default target (like graphical or multi-user), use 'systemctl set-default targetname.target'.

Use 'journalctl -u servicename' to view logs for a specific service when troubleshooting failures.

The difference between 'restart' and 'reload' is critical: reloads do not stop the service, restarts do.

Easy to Mix Up

These come up on the exam all the time. Here's how to tell them apart.

systemctl enable

Creates a symlink in /etc/systemd/system to auto-start at boot.

Does not start the service immediately.

Used to ensure a service runs after every reboot.

systemctl disable

Removes the symlink so the service does not auto-start.

Does not stop a running service.

Used to prevent a service from starting at boot while allowing manual start.

systemctl start

Brings a service from inactive to active state.

Immediate effect on the current session.

Does not change auto-start behaviour at boot.

systemctl stop

Brings a service from active to inactive state.

Immediate effect on the current session.

Does not change auto-start behaviour at boot.

multi-user.target

Boots into a text-mode, multi-user environment.

No desktop environment is started.

Common for servers to save resources.

graphical.target

Boots into a full graphical desktop environment.

Includes the display manager and desktop services.

Common for desktop workstations.

systemctl restart

Stops the service completely, then starts it again.

Causes brief downtime during the stop/start cycle.

Useful after major configuration changes or updates.

systemctl reload

Sends a SIGHUP signal to reload configuration without stopping.

No downtime; service stays running.

Only works if the service explicitly supports reload (most modern web servers do).

Watch Out for These

Mistake

Disabling a service stops it immediately.

Correct

Disable only prevents the service from starting at boot. To stop it right now, you must use 'systemctl stop'. Disable and stop are separate actions.

The word 'disable' sounds like turning something off, so beginners assume it stops the running service.

Mistake

Masking a service is the same as disabling it.

Correct

Masking creates a symlink to /dev/null, making the service unstartable even manually. Disabling just removes the auto-start link—you can still start it with 'systemctl start'.

Both prevent the service from starting, but the exam explicitly tests the difference. Beginners see similar outcomes and conflate them.

Mistake

The only way to change the default target is by editing configuration files.

Correct

You change the default target with 'systemctl set-default target.target' (e.g., 'systemctl set-default multi-user.target'). No file editing required.

Newcomers often think all Linux configuration requires editing text files, but systemd has dedicated commands.

Mistake

Kernel panic means the hard drive is broken.

Correct

A kernel panic is a fatal error in the kernel itself—often due to corrupt kernel image, bad hardware, or filesystem issues—not specifically the hard drive. It shows a message saying 'Kernel panic - not syncing'.

The word 'panic' is dramatic, and beginners blame the most obvious component (the hard drive) rather than understanding it is a kernel-level crash.

Mistake

You can change the boot order of services by renaming unit files.

Correct

You control service ordering with 'After=', 'Before=', 'Wants=', and 'Requires=' directives inside the unit file, not by filename. Renaming would break the service.

Windows users sometimes assume alphabetical ordering; Linux uses explicit dependency declarations.

Mistake

Running 'systemctl reload' stops the service and then starts it again.

Correct

Reload sends a SIGHUP signal to the service to reload its configuration without stopping. This is distinct from 'restart', which fully stops and starts the service.

The word 'reload' sounds like 'restart', so beginners think the service goes down and up. In reality, reload is designed to be a zero-downtime operation.

Do You Actually Know This?

Reveal each answer, then mark whether you got it right. Score 60%+ to unlock the next chapter.

Frequently Asked Questions

What is the difference between 'systemctl enable' and 'systemctl start'?

'systemctl enable' makes a service start automatically at boot time. 'systemctl start' starts the service right now, but it will not survive a reboot unless also enabled.

How do I see which services are currently running?

Use 'systemctl list-units --type=service --state=running' to show all active services. You can also use 'systemctl status' on individual services.

What does 'systemctl daemon-reload' actually do?

It tells systemd to reload its configuration files. You must run this after creating or editing any unit file in /etc/systemd/system so systemd recognises the changes.

How do I make a service start with a delay after boot?

You can set the 'RestartSec' directive in the unit file's [Service] section, but for boot timing, use 'After=' and 'Wants=' dependencies to control order. systemd does not have a simple 'delay' option.

What is the difference between 'restart' and 'reload' in systemctl?

'restart' stops and starts the service completely (downtime). 'reload' sends a signal (SIGHUP) to the service to reload configuration without stopping the process (zero downtime).

Can a service be both enabled and masked?

No. If you mask a service, it cannot be started at all (even manually), so enabling it becomes pointless. The mask overrides enable.

Terms Worth Knowing

Keep going

You've finished System Services and Startup. Continue through the XK0-006 study guide to build a complete picture of the exam.

Done with this chapter?