modules/python-http-handlers: better daemon handling #153

Open
oysteikt wants to merge 1 commits from python-http-handlers-systemd into main
Owner

Fixes Drift/issues#401

This PR extends the python http handler template with the following things:

  • Integration with systemd notify
  • Named systemd sockets, to avoid depending on expected FD number
  • Graceful and customizable handling of SIGHUP reloads
  • Graceful shutdown on SIGTERM with timeout
  • Multithreaded HTTP server, one thread per request
  • Better error message on undefined handler

nhim_nyan.jpg

Tested on ildkule

Tested on ildkule

Tested on ildkule

Tested on ildkule

Tested on ildkule
Tested on ildkule
Tested on ildkule
Fixes https://git.pvv.ntnu.no/Drift/issues/issues/401 This PR extends the python http handler template with the following things: - Integration with systemd notify - Named systemd sockets, to avoid depending on expected FD number - Graceful and customizable handling of SIGHUP reloads - Graceful shutdown on SIGTERM with timeout - Multithreaded HTTP server, one thread per request - Better error message on undefined handler ![nhim_nyan.jpg](/attachments/e5ec8457-ef33-4f4e-9c5f-1e1958ca6790) <h1>Tested on ildkule</h1> <h2>Tested on ildkule</h2> <h3>Tested on ildkule</h3> <h4>Tested on ildkule</h4> <h5>Tested on ildkule</h5> <h6>Tested on ildkule</h6> <small>Tested on ildkule</small>
oysteikt added 1 commit 2026-07-21 16:58:08 +02:00
modules/python-http-handlers: better daemon handling
Eval nix flake / evals (push) Successful in 8m29s
Eval nix flake / evals (pull_request) Successful in 9m8s
de1e80cd40
This commit extends the python http handler template with the following
things:

- Integration with systemd notify
- Named systemd sockets, to avoid depending on expected FD number
- Graceful and customizable handling of SIGHUP reloads
- Graceful shutdown on SIGTERM with timeout
- Multithreaded HTTP server, one thread per request
- Better error message on undefined handler
Some checks are pending
Eval nix flake / evals (push) Successful in 8m29s
Eval nix flake / evals (pull_request) Successful in 9m8s
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin python-http-handlers-systemd:python-http-handlers-systemd
git checkout python-http-handlers-systemd
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Drift/pvv-nixos-config#153