Linux Labs

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

ulimit and sysctl: system ceilings

Not running Starting usually ~20 s
Leave the lesson

Step 9 of 10 · lab · 20 minmedium

A kernel setting disappears

The service that receives the warehouse sensor readings started working once a colleague raised a kernel parameter for it. After a reboot overnight it fails to start again, although the colleague insists the setting was saved. Make the value survive a reboot and keep the rest of the server settings as they were.

Situation

The lab-sensors service — the sensor-hub application — receives the warehouse sensor readings over UDP. Last week it stopped starting. A colleague raised a kernel parameter for it with a command, and the service worked. The server was rebooted overnight, and lab-sensors fails to start again. The colleague insists the setting was saved to a file.

There is no need to reboot the machine: at boot the kernel parameters come from the same files, in the same order, as with sudo sysctl --system.

Task

  1. The lab-sensors service is running, enabled at boot and answers curl http://127.0.0.1:8126/health. The application code stays the same.
  2. The value survives a reboot: sudo sysctl --system sets the parameter the service needs, and takes it from a file in /etc.
  3. The other parameters from the settings files stay as they were — both in the files and in the running kernel.

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-sensors service is running, enabled at boot and answering; the application code is unchanged — not done yet
  • sudo sysctl --system sets net.core.rmem_max to at least 8388608 (8 MiB) — from a file in /etc — not done yet
  • The other parameters from the settings files are unchanged — in the files and in the kernel — 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-sensors service is running, enabled at boot and answering; the application code is unchanged — not done yet
  • sudo sysctl --system sets net.core.rmem_max to at least 8388608 (8 MiB) — from a file in /etc — not done yet
  • The other parameters from the settings files are unchanged — in the files and in the kernel — not done yet
node1 Ubuntu 24.04

Lab goals

0 of 3
  • The lab-sensors service is running, enabled at boot and answering; the application code is unchanged — not done yet
  • sudo sysctl --system sets net.core.rmem_max to at least 8388608 (8 MiB) — from a file in /etc — not done yet
  • The other parameters from the settings files are unchanged — in the files and in the kernel — not done yet
Loading…