From 511b873e1678ad293a42ec12a2a4acf8fd5e3382 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20Pa=C3=9F?= <22845248+mpass99@users.noreply.github.com> Date: Sat, 2 Dec 2023 16:56:43 +0100 Subject: [PATCH] Configure Systemd Socket Activation as new way for Poseidon to accept connections. This should reduce our issues caused by deployments. --- cmd/poseidon/main.go | 4 ++-- docs/configuration.md | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/cmd/poseidon/main.go b/cmd/poseidon/main.go index 89273c0..19e4f4c 100644 --- a/cmd/poseidon/main.go +++ b/cmd/poseidon/main.go @@ -208,9 +208,9 @@ func serveHTTPListener(server *http.Server, l net.Listener) { } if errors.Is(err, http.ErrServerClosed) { - log.WithError(err).WithField("listener", l).Info("Server closed") + log.WithError(err).WithField("listener", l.Addr()).Info("Server closed") } else { - log.WithError(err).WithField("listener", l).Error("Error during listening and serving") + log.WithError(err).WithField("listener", l.Addr()).Error("Error during listening and serving") } } diff --git a/docs/configuration.md b/docs/configuration.md index 973e154..45808fc 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -29,6 +29,12 @@ If a value is not specified, the value of the subsequent possibility is used. - Again, this can be overwritten by the environment variable `POSEIDON_SERVER_PORT`, e.g., using `export POSEIDON_SERVER_PORT=5000`. +### Systemd + +Poseidon can be configured to run as a systemd service. Poseidon can optionally also be configured to use a systemd socket. +The use of systemd provides capabilities for managing Poseidon's state and zero downtime deployments. +Minimal examples for systemd configurations can be found in `.github/workflows/resources`. + ## Nomad