Lesson 8 — Processes & Services Basics
systemctl + logs
In Linux, programs do not all behave the same way. Some run once and end. Others stay running in the background and support the whole system. This lesson teaches the difference between a process and a service, how systemd manages services, and how to use systemctl and journalctl to inspect what is happening.
A process is a running instance of a program. A service is usually a background process managed by the system so it can start, stop, restart, and sometimes auto-start at boot.
Check whether a service is running, start or stop it safely, restart it after changes, and review system logs when something fails.
Lesson Objectives
By the end of this lesson
- Explain what a process is
- Explain what a service is
- Use
systemctl statusto inspect a service - Start, stop, and restart a service
- Check logs with
journalctl
Why this matters
- Web servers, SSH, databases, and security tools usually run as services
- Many Linux problems are really “service not running” or “service failed to start” problems
- Logs often tell you what the screen does not
1) Process vs Service
What is a process?
A process is a program that is currently running. If you open an editor, terminal, browser, or script, Linux creates a process for it. Each process has an ID called a PID.
What is a service?
A service is usually a background program that helps the system or network function. Services often start at boot and continue running without a user staring at them directly.
Common examples:
- sshd for remote login
- nginx or apache2 for websites
- cron or timers for scheduled jobs
Every service is made of processes, but not every process is a managed service.
2) systemd and systemctl
On many modern Linux systems, systemd is the system and service manager. The main command you use to interact with it is systemctl.
Check status
See whether a service is active, inactive, failed, or disabled.
Start / Stop / Restart
Basic control actions for common service troubleshooting.
Enable at boot
Enable a service so it starts automatically when the system boots.
Reload vs restart
Some services can reload configuration without a full restart.
3) Reading Logs with journalctl
If a service will not start or keeps failing, logs are often your best clue. On systemd-based systems, journalctl reads the system journal.
Show recent logs
This can show recent errors and context around problems.
Show logs for one service
The -u flag filters by unit name, which is often the specific service you are troubleshooting.
Show latest entries first
This is useful when you want the most recent lines without scrolling through everything.
Do not just restart a failing service over and over. Check the logs and learn why it failed.
4) Fast Troubleshooting Pattern
- Check whether the service is active with
systemctl status - If it failed, read logs with
journalctl -u service-name - Fix the likely cause
- Restart the service
- Check status again
Practical — Inspect a Service and Check Logs
This practical gives the learner a simple admin workflow instead of random command memorization.
Practical Task
- Pick a service that exists on your system, such as
ssh,sshd,cron,nginx, or another known unit - Check its status
- Read recent logs for that unit
- Write one sentence explaining whether it looks healthy or not
Walkthrough
Look for words like active (running), inactive, failed, or repeated error messages in the journal output.
Write Your Observation
Use a simple note like a junior admin would write.
Mini Knowledge Check
Score 75% or higher to unlock the next lesson link. Your score is saved on this browser.
1) What is the best description of a process?
2) Which command is commonly used to check the status of a service on a systemd-based system?
3) Which command is best for reviewing journal entries for a specific service?
4) What is the strongest troubleshooting habit here?
Next Lesson
Tip: update the next lesson link when your page exists.