Step 7 of 8 · lab · 25 min
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
- The
lab-inventoryservice runs as the inventory user and answerscurl 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. - Do not widen permissions "for everyone": no file, directory or socket needs write access for any user.
lab-relayruns as relay, as before. - 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
The machine is starting
Hints
0 of 3Lab 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
Goals are checked on the machine after every command.