Lesson 8 — Processes & Services Basics (systemctl + logs)

CompTIA Cyber Path • Linux / Admin Basics • Lesson 8

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.

Core idea:

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.

What you’ll be able to do:

Check whether a service is running, start or stop it safely, restart it after changes, and review system logs when something fails.

Linux basics systemctl journalctl local progress saved
Progress: 0%
User Runs Programforeground or background
Process ExistsPID, state, resources
Service Managed by systemdstart / stop / restart / enable
Check Logsjournalctl helps explain failures
Good troubleshooting flow: Is it running?What state is it in?What do the logs say?

Lesson Objectives

By the end of this lesson

  • Explain what a process is
  • Explain what a service is
  • Use systemctl status to 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.

ps aux top

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
Important distinction:

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.

sudo systemctl status ssh sudo systemctl status nginx

Start / Stop / Restart

Basic control actions for common service troubleshooting.

sudo systemctl start nginx sudo systemctl stop nginx sudo systemctl restart nginx

Enable at boot

Enable a service so it starts automatically when the system boots.

sudo systemctl enable nginx sudo systemctl disable nginx

Reload vs restart

Some services can reload configuration without a full restart.

sudo systemctl reload nginx

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

journalctl -xe

This can show recent errors and context around problems.

Show logs for one service

journalctl -u nginx journalctl -u ssh

The -u flag filters by unit name, which is often the specific service you are troubleshooting.

Show latest entries first

journalctl -u nginx -n 50 –no-pager

This is useful when you want the most recent lines without scrolling through everything.

Real-world habit:

Do not just restart a failing service over and over. Check the logs and learn why it failed.

4) Fast Troubleshooting Pattern

  1. Check whether the service is active with systemctl status
  2. If it failed, read logs with journalctl -u service-name
  3. Fix the likely cause
  4. Restart the service
  5. Check status again
sudo systemctl status nginx sudo journalctl -u nginx -n 30 –no-pager sudo systemctl restart nginx sudo systemctl status nginx

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

sudo systemctl status ssh sudo journalctl -u ssh -n 25 –no-pager

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

🔒 Locked until quiz ≥ 75% and you mark complete
Lesson 9 — Networking Troubleshooting Basics

Tip: update the next lesson link when your page exists.

Leave a Comment