Inside the system: resources, kernel, processes / Stage 10 of 12 · step 7 of 8
A service holds up the boot
Situation
The warehouse server runs two services: the order desk lab-orders (http://127.0.0.1:8090) and the
stock store lab-stock. At startup the order desk loads the stock levels from the store — without
them it accepts no orders.
After every reboot the server takes half a minute longer to boot, and lab-orders ends up failed — the
on-call admin brings the services up by hand later. A colleague insists the service dependencies are
set up; the units are in /etc/systemd/system/.
The machine is now as it is after such a boot: lab-orders has just tried to start.
Task
lab-ordersstarts thelab-stockstore itself and starts after it: the dependencies live in its unit (Wants=andAfter=), with no reverse ordering.systemd-analyze verify lab-orders.service lab-stock.serviceprints no warnings.lab-ordersis running, enabled at boot and answering:curl http://127.0.0.1:8090/health.- After a reboot (
sudo reboot)lab-orderscomes up on its own at the first attempt and holds up the boot for no more than 10 seconds.
Constraints
- Do not change the application code —
/usr/local/bin/order-deskand/usr/local/bin/stock-store. - You may reboot the machine as often as you like: the terminal shows the boot and logs in as
studentagain. "Check" looks at a boot that happened after the machine was prepared, so reboot it after your fix.
There is no internet on the machine; everything you need is installed. How the service starts is visible in
systemctl status lab-ordersandjournalctl -u lab-orders; what holds up the boot — insystemd-analyze blameandsystemd-analyze critical-chain.
Lab goals
0 of 4-
lab-orders starts the lab-stock store itself and starts after it (Wants= and After=), with no reverse ordering — not checked yet
-
systemd-analyze verify lab-orders.service lab-stock.service prints no warnings — not checked yet
-
lab-orders is running, enabled at boot and answers on http://127.0.0.1:8090/health; the application code is unchanged — not checked yet
-
After a reboot (sudo reboot) lab-orders came up on its own at the first attempt and held up the boot for no more than 10 s — not checked yet