READDEMOGUIDED LABINDEPENDENT LABQUIZREVIEW
Module 5 of 7 · 25 min

Processes and services

Beginner · 2/5

Written by CoreQ Academy (drafted with AI assistance). Awaiting review by Sean Ofodile.

You will be able to
  • List and rank processes
  • Stop a process safely
  • Check, start and stop services with systemctl and journalctl

Every program is a process

Each running program has a process ID (PID) and an owner. ps aux lists all processes with CPU and memory use; top ranks the busiest.

Stopping processes

kill PID asks a process to stop. You can only signal your own processes unless you are root. Check what a PID is before you kill it.

Services

Long-running daemons are managed by systemd. systemctl status shows state and recent logs; journalctl -u NAME shows the service's log history.

$ systemctl status nginx
$ sudo systemctl restart nginx
$ journalctl -u nginx -n 20

Demo: try these in the terminal

ps auxsee all processes and owners
toprank by CPU
systemctl list-unitssee all services
journalctl -u webappread a failing service's logs

Quiz

Knowledge quiz · pass mark 80%
  1. Which command shows the last 20 log lines for the webapp service?
  2. Show the status of the nginx service.
    $
  3. What identifies a specific running process?
  4. What is the difference between enable and start?
  5. A service fails with "cannot read config: Permission denied". Best first step?
  6. List every process with user, CPU and memory columns.
    $
  7. A regular user can kill processes owned by other users.
  8. Order the steps for handling a CPU hog.
    1. check the owner and command line
    2. confirm it is gone and services are healthy
    3. kill PID
    4. top or ps aux to find it