Axel Verne → Junk Drawer kit → Chapter 17

Chapter 17 — When It Breaks: The Field Guide

5 blocks to copy, in the order they appear in the chapter. Nothing here is required to be typed by hand.

The universal first three

17.1 · bash
ping <device-ip>                  # is it on the network at all?
ssh you@<device-ip> 'uptime'      # is it up, and did it just reboot?
ssh you@<device-ip> 'docker ps'   # what's actually running?

"One app is down" — the container is unhappy

17.2 · bash
cd /srv/lab/compose/<app>
docker compose ps                 # Up? Restarting? Exited?
docker compose logs --tail 100    # the last thing it said

Disk full

17.3 · bash
df -h                              # which filesystem
sudo du -xh --max-depth=2 /srv/lab | sort -h | tail -20   # what's big
docker system df                   # how much is Docker's
17.4 · json
{ "log-driver": "json-file", "log-opts": { "max-size": "10m", "max-file": "3" } }

Slow

17.5 · bash
sudo fallocate -l 2G /swapfile && sudo chmod 600 /swapfile
sudo mkswap /swapfile && sudo swapon /swapfile
echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab

← Chapter 16Chapter 18 →

Get the next build in your inbox

An email when a new build write-up goes up: what I ran, on what hardware, and the commands that paste. Free, unsubscribe any time. The kit stays free either way.