Loading
0x1B0Lesson 28 of 28

Mission: the 3 a.m. outage

You’re on call and the server is down. Diagnose it and bring it back.

25 min 4-question quiz 1 code exercise
By the end of this lesson you can
  • Work through an outage methodically, from symptoms to causes
  • Fix full disks, runaway processes and bad permissions
  • Explain a fix, and how to stop it happening again

03:07. Your pager goes off. The station’s comms server has stopped responding, and with it, the link to Earth. You’re the on-call engineer, and you’re the only one awake.

Good engineers don’t guess. They look at the evidence, change one thing at a time, and confirm that it worked. There’s more than one thing wrong tonight.

Try it

Up to 15 XP

Bring comms back online

Use df -h, du -h, ps, ls -l, cat and tail to find each problem. When you’ve fixed everything, run ./start-comms.sh.

Mission 1 of 6

Read the runbook

Pager: “COMMS DOWN.” Start with what the team already knows. How many checks are in the runbook?

Simulated shell. Try ls, or type help to see the commands.

/home/crew/comms
  • comms.conf
  • data
    • contacts.db
  • logs
    • comms.log
    • indexer-dump.bin
  • runbook.txt
  • start-comms.sh
Up arrow: history. Tab: complete. Ctrl-L: clear. Ctrl-C: cancel.
  1. Read the runbook
  2. Find the first error
  3. Free the disk
  4. Stop the runaway
  5. Fix the config
  6. Restore comms

Try it

Up to 15 XP

Write the follow-up

Fixing it is half the job. Decide which of these actions would stop this happening again.

0 of 5 sortedScore 0/0
  • “Alert when the disk passes 80%, before it’s a crisis.”

  • “Limit where the indexer can write, and rotate its output.”

  • “Tell the on-call engineer to be more careful.”

  • “Keep the start script’s permissions in version control.”

  • “Delete the runbook, since it’s now out of date.”

Key takeaways

  • Read the runbook and the logs before changing anything.

  • Find the first error, and change one thing at a time.

  • A fix isn’t finished until you’ve stopped it happening again.

Lesson quiz

4 questions · pass with 3 correct · up to 50 XP

Passing this quiz completes the lesson and keeps your streak going. Questions you miss come back in review sessions later.

Practice: write Bash scripts

Write a script in the editor and run it for real against sample input. Each run gets a fresh Linux sandbox with Bash 5.2 and the GNU tools on Wandbox, a free public service - so experiment freely, even with rm. Your script and test input are sent there.

Exercise 1

Triage the logs

+25 XP

stdin is a server log of TIME LEVEL message lines. Print first error: TIME, using the first ERROR line, then errors: N. If there are no errors, print just all clear.

  • An outage
  • A quiet night
script.sh
Loading editor…

Your script runs with Bash 5.2 and GNU tools on Wandbox, a free public service, in a fresh sandbox each time. Your script and test input are sent to that service.

Questions about this lesson

Stuck? Ask. Figured something out? Share it. Explaining is one of the best ways to learn.

Loading posts…