Module 01 · DevOps · Containers & Docker · about 17 min to read
Continue where you left off ×
The services on the box: systemd, journald and first triage
VMs, Bare Metal & SSH · Open board
A plain virtual machine you log into over SSH. This lesson is about what is already running on that machine when you arrive, and what to type first when one of those programs is not working.
Before you start. From Linux and the Shell: Processes, Files, Pipes, Permissions and Signals you need PID 1, the first process on the machine, and the exit codes 143 and 137 that a process reports when a signal ends it. From From power button to PID 1: how a machine boots you need one fact: on a normal Linux server the program that runs as PID 1 is systemd. From Watching a live machine: perf, strace and flame graphs you need strace, a tool that prints every request a program makes to the kernel. This lesson uses all three.
The idea in 30 seconds
systemd is PID 1 on most servers, and each thing it manages is a unit, most often a service.
Restart= makes systemd start a crashed program again, and a start limit stops it from looping forever.
The journal holds everything each unit printed, and journalctl -u <unit> -p err finds the error.
A timer starts a unit at a calendar time, and systemd-analyze calendar shows the next run.
Triage order: unit state and ports, disk, processor and memory, journal, strace.
df reports used divided by used plus available, so 39 GB used and 8.7 GB free is 82%.
Read the story
Lesson 4 of 70 in DevOps
The rest of this lesson is part of a plan.
A plan opens every lesson, board, video, lab and paper on chalk. Yearly is $39/year .
See plans Already a member? Sign in
Or start free : a free account opens lessons 2 and 3 of every track.
In this lesson 2 a.m.: the orders service is down A unit is one thing systemd looks after A restart policy decides what happens after a crash The journal keeps what every unit printed A timer starts a unit at a set time Five commands, in this order A unit file, line by line The restart settings How a stop works journald in more detail Timers The five commands, measured What these tools do not cover Terms it explains: unit, service, restart policy, journal, timer, triage, Common mistakes, user, calendar, relative.
Review DevOps
Mark as read Saved in this browser, and to your account when you sign in.