Linux Labs

Inside the system: resources, kernel, processes / Stage 7 of 12

strace and /proc: what a process is doing

Not running Starting usually ~20 s
Leave the lesson

Step 4 of 8 · on a machine · 4 min

A process that waits

strace can also attach to a process that is already running — that shows what it is stuck on right now.

In ~/import-lab the lab-import service loads orders: the importer program should write imported.txt and exit. Today it has been running for an hour, and there is no file.

Exercise · look

Attach to importer

In ~/import-lab, find the importer process, attach strace to it for three seconds — first without sudo, then with sudo — and look at its open files in /proc.

First, predict

importer is running but doing nothing. What will strace show in three seconds?

Now start the exercise, run the command and compare your prediction with the output.

Sign in and start The machine is available after signing in
Ubuntu 24.04
Loading…