Linux: Processes & Systems

Know what the machine decided

A running machine is making decisions without you: what to schedule, what to restart, what to write down, and what to kill when it runs out of memory. This is how to find out which of those it made and why — and how to put a service of your own under the same supervision, on a machine you are willing to break.

Modules
6
Drills
0
Build steps
11
Time
~4h

Walk out able to

Take a machine you did not set up, find out why a service stopped coming back, and put one of your own under supervision that survives its own failures.

What you work on

01

Processes and their states

Read a listing; name the one no signal can end.

02

Signals and the two that win

Ask a process to stop; know what insisting costs.

03

Units that come back

Restart policies, ordering, and why it did not.

04

Schedules, logs and limits

cron fields, journal filters, and the refusal itself.

What you get

Skills that stick

Every project mixes short lessons, focused drills and real build steps, so you finish with working code and the judgement behind it.

You will practise

  • Process states, signals and signal targets
  • Restart policies, and dependency versus order
  • Crontab fields, and why a job did nothing
  • Journal filters, limits and the memory killer

Afterwards you can

  • Read a process listing and name every state
  • Stop a process without losing its cleanup
  • Say why a unit did not come back after a boot
  • Get an answer out of a journal in one command

Modules

Step by step

Each module builds on the last. Read a short lesson, drill it until it's second nature, then put it to work.

  1. 1

    Where a process comes from

    ~42 min

    Get a Linux you can break, read its process table, and account for every row.

    • LessonWhat the machine decides without you4 min
    • Build stepGet a Linux you can break10 min
    • LessonRead a process table line by line13 min
    • LessonAccount for where a process came from15 min
  2. 2

    Ask it to stop, then insist

    ~41 min

    Send the right signal to the right thing, and know what the uncatchable one costs.

    • LessonSay what each signal does to a process15 min
    • LessonAim a signal at exactly one thing12 min
    • Build stepKill something that refuses to stop14 min
  3. 3

    Make it come back

    ~45 min

    Write a unit, choose a restart policy, and say why the order it started in was wrong.

    • LessonRead a unit file as a promise14 min
    • LessonTell a dependency from an order13 min
    • Build stepWrite a program that fails on purpose6 min
    • Build stepPut it under a restart policy7 min
    • Build stepCount what the manager actually did5 min
  4. 4

    Work that happens without you

    ~25 min

    Read a crontab line for when it fires, and know why it did nothing when it did.

    • LessonRead a crontab line for when it fires13 min
    • LessonExplain a job that ran and did nothing12 min
  5. 5

    Find out what it said

    ~28 min

    Ask the journal a narrow question, and get the direction of its filters right.

    • LessonAsk the journal a narrow question14 min
    • Build stepProve which way the filter points8 min
    • Build stepFind a real failure on your machine6 min
  6. 6

    What the system will not give

    ~51 min

    Recognise a refusal by the failure it produces, and predict who the kernel kills.

    • LessonName the failure a limit produces14 min
    • LessonPredict who the kernel kills first13 min
    • Build stepStage the log the services will read4 min
    • Build stepMake a producer run without you7 min
    • Build stepClassify every line into the journal8 min
    • Build stepAsk it the one question5 min

A taste of the code

it starts by hand, and fails on every boot
[Unit]
Description=Relay the feed
Requires=feed.service

$ systemctl status relay.service

● relay.service - Relay the feed
     Active: failed (Result: exit-code)
   Main PID: 4471 (code=exited, status=1/FAILURE)

relay[4471]: cannot open /var/lib/feed/latest: No such file or directory

Ready when you are.

Work through it at your own pace and pick up right where you left off.