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 7 of 8 · lab · 25 minmedium

An application exits silently

After moving to a new server, the warehouse inventory service will not start — and says not a word about why. Find the cause from what the process does and fix it so that the service survives a restart and nobody gets permissions they should not have.

Situation

The warehouse moved to a new server. The inventory service lab-inventory — the inventory-api application — does not start in its new home: systemctl status lab-inventory shows status=1/FAILURE, and the journal has not a single line from the application itself. The application settings were moved over. The backup of the old server is in /var/backups/inventory. The application records every request through the event service lab-relay — that one is running.

There is no source code of the application on the machine, only the built program. Its author left long ago.

Task

  1. The lab-inventory service runs as the inventory user and answers curl http://127.0.0.1:8085/health; the warehouses in the answer are the same as on the old server. The application code stays the same.
  2. Do not widen permissions "for everyone": no file, directory or socket needs write access for any user. lab-relay runs as relay, as before.
  3. The application still answers after both services restart: sudo systemctl restart lab-relay lab-inventory.

There is no internet on the machine; everything you need is already installed. Run administrative commands with sudo.

Lab · on your own

No commands are given in this lab: type them in the terminal yourself. Goals are checked on the machine after every command.

Goals

0 of 3
  • The lab-inventory service runs as inventory and answers /health with the old server's warehouses; the application code is unchanged — not done yet
  • Write access is not opened to everyone anywhere, and lab-relay runs as relay, as before — not done yet
  • The application answers after both services restart — not done yet
Ctrl+Enter
Starts the machine node1 · Ubuntu 24.04

The machine is starting

Hints

0 of 3

Lab goals

0 of 3
  • The lab-inventory service runs as inventory and answers /health with the old server's warehouses; the application code is unchanged — not done yet
  • Write access is not opened to everyone anywhere, and lab-relay runs as relay, as before — not done yet
  • The application answers after both services restart — not done yet
node1 Ubuntu 24.04

Lab goals

0 of 3
  • The lab-inventory service runs as inventory and answers /health with the old server's warehouses; the application code is unchanged — not done yet
  • Write access is not opened to everyone anywhere, and lab-relay runs as relay, as before — not done yet
  • The application answers after both services restart — not done yet
Loading…