From 8f0531b9edf030c21ead48ffd654cae442f2334f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= <hugo@lysator.liu.se> Date: Tue, 10 Aug 2021 14:45:31 +0200 Subject: [PATCH] Move studieinfo.sock from /tmp to /run/studieinfo. --- manifests/init.pp | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/manifests/init.pp b/manifests/init.pp index 1f75f31..6e26797 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -1,7 +1,8 @@ # This manifest is intended to manage studieinfo.lysator.liu.se class studieinfo { - $socket = '/tmp/studieinfo.sock' + $sockdir = 'studieinfo' + $socket = "/run/${sockdir}/studieinfo.sock" $uwsgi_host = 'localhost' $uwsgi_port = 8000 @@ -27,6 +28,26 @@ class studieinfo { ensure => latest, } + + $dropin = '/etc/systemd/system/studieinfo-web.service.d/override.conf' + file { dirname($dropin): + ensure => directory, + } + + # Needed since nginx.service contains PrivateTmp=true since some + # version back. Meaning that it couldn't find the UWSGI socket + # there. + # That flag could be turned off, but it seems more robust to + # actually put the socket into /run + file { $dropin: + ensure => file, + notify => Service['studieinfo-web'], + content => @("EOF") + [Service] + RuntimeDirectory=${sockdir} + | EOF + } + service { 'studieinfo-web': ensure => running, enable => true, @@ -44,6 +65,7 @@ class studieinfo { class { '::nginx': proxy_cache_path => '/tmp/cache', proxy_use_temp_path => 'off', + # TODO flush this after seacrh backend reload proxy_cache_keys_zone => 'search_cache:100m', gzip => 'on', http_tcp_nopush => 'on', @@ -148,7 +170,7 @@ class studieinfo { location_cfg_append => { include => 'uwsgi_params', - uwsgi_pass => "unix:${socket}", + uwsgi_pass => "unix://${socket}", }, } -- GitLab