From 812200ccd64b8bd2f861a9007b3d94eefbd51afe Mon Sep 17 00:00:00 2001 From: Brad Baker Date: Tue, 23 Jun 2026 16:08:27 +1000 Subject: [PATCH] termix - patch tmp nginx behaviour to match the install script (#15283) * Update Nginx configuration and service files to deal with /tmp update issues Create necessary directories and configuration files for Nginx service. * Refactor pidfile.conf creation in termix.sh Reformatted the creation of pidfile.conf for consistency. * Clean up old nginx configuration files Remove old nginx configuration files before creating new ones. * Update ct/termix.sh Co-authored-by: Tobias <96661824+CrazyWolf13@users.noreply.github.com> * Update ct/termix.sh Co-authored-by: Tobias <96661824+CrazyWolf13@users.noreply.github.com> * Update ct/termix.sh only create if it doesn't exist * Update termix.sh * Fix heredoc syntax --------- Co-authored-by: Tobias <96661824+CrazyWolf13@users.noreply.github.com> Co-authored-by: Sam Heinz --- ct/termix.sh | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/ct/termix.sh b/ct/termix.sh index 8b3140b71..a7551f6e0 100644 --- a/ct/termix.sh +++ b/ct/termix.sh @@ -206,9 +206,25 @@ EOF sed -i 's|/app/html|/opt/termix/html|g' /etc/nginx/nginx.conf sed -i 's|/app/nginx|/opt/termix/nginx|g' /etc/nginx/nginx.conf sed -i 's|listen ${PORT};|listen 80;|g' /etc/nginx/nginx.conf - rm -f /etc/systemd/system/nginx.service.d/pidfile.conf rm -f /etc/tmpfiles.d/nginx-termix.conf + + if [ ! -d /tmp/nginx ]; then + mkdir -p /tmp/nginx + fi + + if [ ! -f /etc/tmpfiles.d/nginx-termix.conf ]; then + echo "d /tmp/nginx 0755 nobody nogroup -" >/etc/tmpfiles.d/nginx-termix.conf + fi + + if [ ! -f /etc/systemd/system/nginx.service.d/pidfile.conf ]; then + mkdir -p /etc/systemd/system/nginx.service.d/ + cat <<'EOF' >/etc/systemd/system/nginx.service.d/pidfile.conf +[Service] +PIDFile=/tmp/nginx/nginx.pid +EOF + fi + systemctl daemon-reload nginx -t && systemctl restart nginx msg_ok "Updated Nginx Configuration"