kolibri icon indicating copy to clipboard operation
kolibri copied to clipboard

kolibri-server leaves kolibri.service enabled and competing with nginx for its port

Open rtibblesbot opened this issue 1 week ago • 2 comments

❌ This issue is not open for contribution. Visit Contributing guidelines to learn about the contributing process and how to find suitable issues.

[!NOTE] On hold until #15992 shows whether kolibri-server's nginx stack stays; the fix depends on it. #15506 waits on this issue.

Target branch: develop

Observed behavior

  • kolibri-server's postinst stops kolibri.service and never disables it. kolibri's postinst enabled it. The README says it is disabled.
  • At boot kolibri.service runs kolibri start, which serves HTTP on HTTP_PORT. That is the kolibri-server/port the postinst writes to options.ini and nginx listens on.
  • With kolibri-server/port 80, kolibri start cannot bind the port today, so nginx always gets it. #15506 launches kolibri.service with CAP_NET_BIND_SERVICE, so on port 80 the service that starts first holds it, as already happens on 8080 and 8008.
  • With #15506, a fresh apt install kolibri-server that configures kolibri before nginx-full saves HTTP_PORT = 80 and starts kolibri.service on port 80 before nginx is configured.

Expected behavior

On a host with kolibri-server installed, only nginx listens on kolibri-server/port.

User-facing consequences

nginx cannot start while kolibri.service holds its port. kolibri-server.init stops Kolibri and starts nginx only if no nginx process exists when it runs.

Steps to reproduce

  1. On Ubuntu 24.04, run apt install kolibri-server and choose 80 for kolibri-server/port.
  2. Run systemctl is-enabled kolibri. It prints enabled.
  3. Install the kolibri .deb built from #15506's pull request, then reboot.
  4. Run ss -ltnp 'sport = :80' to see which process holds port 80.

Context

  • platforms/debian-server at 886a0c9f24da6f6d5163d2879826170fcd2bbf00.
  • kolibri .deb with #15506.

Acceptance Criteria

  • [ ] After a reboot of a host with kolibri-server installed, nginx holds kolibri-server/port and no Kolibri process listens on it, for each choice: 8080, 8008 and 80.
  • [ ] A fresh apt install kolibri-server ends with nginx listening on kolibri-server/port, whether apt configures kolibri or nginx-full first.
  • [ ] After apt remove kolibri-server, kolibri.service serves HTTP again after a reboot.
  • [ ] platforms/debian-server/README.rst states whether kolibri.service is enabled on a kolibri-server host, and matches what the postinst does.

AI usage

Drafted by Claude Code while working #15506, from reading the maintainer scripts of the kolibri and kolibri-server packages.

rtibblesbot avatar Nov 23 '26 20:11 rtibblesbot

On hold until #15992 shows whether kolibri-server's nginx stack stays. How kolibri.service and kolibri-server share the port depends on that. #15506 waits for this, so port 80 doesn't ship before it's settled.

rtibbles avatar Nov 24 '26 21:11 rtibbles

Marked on hold at the top of the body. Blocked-by #15992 and blocking #15506 relationships were already set.

rtibblesbot avatar Nov 25 '26 00:11 rtibblesbot