From 216fb9b3cfa4c1e8dce69f5f11bff0e1316158e5 Mon Sep 17 00:00:00 2001 From: kidhab <32387157+kidhab@users.noreply.github.com> Date: Mon, 25 Apr 2022 12:41:40 +0200 Subject: [PATCH] Enabled systemd socket activation (PR #942) With this [configuration](https://github.com/puma/puma/blob/master/docs/systemd.md) puma automatically binds to all systemd activated sockets. With socket activation systemd opens the listening socket(s) in advance and provides them to the Puma master process on startup. This keeps listening sockets open across puma restarts and achieves graceful restarts. --- config/puma.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/config/puma.rb b/config/puma.rb index c341524a..89237c1b 100644 --- a/config/puma.rb +++ b/config/puma.rb @@ -11,6 +11,9 @@ threads threads_count, threads_count # port ENV.fetch("PORT") { 3000 } +# Bind automatically to all systemd activated sockets +bind_to_activated_sockets + # Specifies the `environment` that Puma will run in. # environment ENV.fetch("RAILS_ENV") { "development" }