From 18c4d4ca82d66789fd9c2120c0fefed932ceff60 Mon Sep 17 00:00:00 2001 From: Georg Pfuetzenreuter Date: Apr 14 2024 20:13:08 +0000 Subject: Repair TSP Puma socket The socket activation did not work properly, and did not place the file in a FHS compliant location. Drop it in favor of a native Puma socket. Signed-off-by: Georg Pfuetzenreuter --- diff --git a/pillar/role/web_tsp.sls b/pillar/role/web_tsp.sls index 7c635c6..fe66cfb 100644 --- a/pillar/role/web_tsp.sls +++ b/pillar/role/web_tsp.sls @@ -15,7 +15,7 @@ nginx: tsp.opensuse.org.conf: config: - upstream tsp: - - server: unix:///var/cache/tsp/puma.socket + - server: unix:///run/tsp/puma.socket - server: - listen: '[::]:80 default_server' - server_name: tsp.opensuse.org diff --git a/salt/profile/tsp/files/tsp.service b/salt/profile/tsp/files/tsp.service index eaf996f..936634a 100644 --- a/salt/profile/tsp/files/tsp.service +++ b/salt/profile/tsp/files/tsp.service @@ -10,7 +10,9 @@ Type=simple User=tsp WorkingDirectory=/srv/www/travel-support-program +RuntimeDirectory=%N Environment="RAILS_ENV=production" +Environment=BIND=unix:///run/tsp/puma.socket ExecStart=/usr/bin/bundler.{{ ruby }} exec puma -C /srv/www/travel-support-program/config/puma.rb ./config.ru diff --git a/salt/profile/tsp/files/tsp.socket b/salt/profile/tsp/files/tsp.socket deleted file mode 100644 index d71e61c..0000000 --- a/salt/profile/tsp/files/tsp.socket +++ /dev/null @@ -1,16 +0,0 @@ -{{ pillar['managed_by_salt'] }} - -[Unit] -Description=Travel Support Program Socket - -[Socket] -SocketUser=wwwrun -SocketGroup=www -ListenStream=/var/cache/tsp/puma.socket - -NoDelay=true -ReusePort=true -Backlog=1024 - -[Install] -WantedBy=sockets.target diff --git a/salt/profile/tsp/init.sls b/salt/profile/tsp/init.sls index 6791c96..c676449 100644 --- a/salt/profile/tsp/init.sls +++ b/salt/profile/tsp/init.sls @@ -85,13 +85,6 @@ tsp_assets_precompile: - require_in: - service: tsp_service -/etc/systemd/system/tsp.socket: - file.managed: - - source: salt://profile/tsp/files/tsp.socket - - template: jinja - - require_in: - - service: tsp_service - /srv/www/travel-support-program/config/site.yml: file.managed: - source: salt://profile/tsp/files/site.yml