rqbit icon indicating copy to clipboard operation
rqbit copied to clipboard

[WIP] Systemd socket activation

Open Stebalien opened this issue 4 months ago • 2 comments

I'm submitting this early for feedback in case you aren't interested in maintaining/accepting this feature.

This PR implements systemd socket activation support (WIP). It makes it possible to auto-start rqbit (via systemd) when the user opens the webui, connects to the API, etc.

Implementation wise, this patch simply checks if the process has been passed a file descriptor by systemd and, if so, it uses that file descriptor as the API socket instead of opening a new one. This change doesn't add any new dependencies.

The main remaining TODO item is to implement a way to create a "dual stack" TcpListener from a file descriptor (requiring changes to https://github.com/ikatson/librqbit-dualstack-sockets).

The unit files (in the new systemd directory) are provided for documentation purposes and will likely need to be modified by the end-user (I'll add a README to the systemd directory later).

Stebalien avatar Oct 31 '25 21:10 Stebalien

The PR to librqbit-dualstack-sockets is up: https://github.com/ikatson/librqbit-dualstack-sockets/pull/3

Stebalien avatar Nov 03 '25 21:11 Stebalien

I've tested this locally against https://github.com/ikatson/librqbit-dualstack-sockets/pull/3 and it works.

Stebalien avatar Nov 03 '25 21:11 Stebalien

@ikatson when you get a chance, could you update librqbit-dualstack-sockets in librqbit-utp? That'll let me use that here and move this PR forward.

Stebalien avatar Feb 12 '26 22:02 Stebalien

done and published utp 0.7.0

ikatson avatar Feb 14 '26 10:02 ikatson

This should now be ready:

  • I put the documentation in the README itself.
  • I removed the .path unit, but I'm happy to add some text to the readme describing how to auto-activate rqbit when .torrent files appear in their ~/Download directory.

Stebalien avatar Feb 18 '26 00:02 Stebalien