LAB-PROC-05 - Service Persistence: systemd
Service Persistence: systemd
Understand what systemd is responsible for and practice basic service inspection before attempting custom service creation.
- Inspect service state with systemctl.
- Explain why a service manager is different from manual process launching.
- Do not create or modify real services on a production machine while learning. Start with inspection first.
Part A: The Field Guide
A service manager exists so important background programs are not left to luck.
Compared with a manual process, a service can be:
- started in a standard way
- monitored by a supervisor
- restarted when appropriate
- enabled to start on boot
- tied into a central logging system
On most modern Linux systems, that service manager is systemd.
Beginner Rule
Inspect existing services first. Build custom service files later, and only on a training machine or VM.
Part B: The Drill Deck
Terminal required: this lab is inspection-first.
G Guided Step by step - type exactly this and compare the result >
Exercise G1: Inspect one known service
- Run
systemctl status sshorsystemctl status cronor another common local service - Look for whether it is active or inactive
- Notice that
systemctl statusalso shows recent log lines - Quit the view with
qif needed
Exercise G2: Compare start and enable conceptually
Explain the difference:
startmeans run nowenablemeans configure it to start at boot
You do not need to change real service settings yet to understand the distinction.
Exercise G3: Inspect the journal for one service
- Run
journalctl -u ssh --no-pager | tail -n 10 - If your system uses a different service name, substitute accordingly
- Notice how service logs can be read from the journal
S Solo Task described, hints available - figure it out >
Exercise S1: Find the unit file path
- Run
systemctl statuson a known service - Look for the
Loaded:line - Note where the unit file is coming from
Exercise S2: Think through the service-manager advantage
In your own words, explain why tmux and nohup are still not the same thing as a supervised service managed by systemd.
M Mission Real scenario - no hints, combine multiple skills >
Mission M1: Plan, do not rush
Describe the safe sequence you would follow before creating a custom service on a real machine:
- test the command manually first
- confirm the correct user and working directory
- write the unit on a training system
- reload systemd and inspect status carefully
- only then consider enabling it
If that sequence makes sense, you are learning service persistence responsibly.