From b4f652b5a57fb3c20cf04fbd8f5f510fa2762e4e Mon Sep 17 00:00:00 2001 From: udo Date: Thu, 16 Jul 2026 22:03:54 +0000 Subject: [PATCH] Preserve socket runtime directory --- docs/wasm-runtime-architecture.md | 2 ++ scripts/deb/uce.service | 1 + scripts/systemd/uce.service | 1 + 3 files changed, 4 insertions(+) diff --git a/docs/wasm-runtime-architecture.md b/docs/wasm-runtime-architecture.md index 304a190..bebc1bf 100644 --- a/docs/wasm-runtime-architecture.md +++ b/docs/wasm-runtime-architecture.md @@ -150,6 +150,8 @@ owns `/run/uce/fastcgi.sock`; UCE validates and adopts the single named listener after exec. The listener therefore remains connectable and queues requests while the service and its post-fork workers restart. Direct launches without systemd activation retain the existing configured Unix/TCP listener behavior. +The service preserves its runtime directory across service restarts because the +socket unit, not the service unit, owns a listener path inside that directory. On termination the parent asks render workers to close their listeners, finish accepted connections within the bounded worker drain interval, and only then exits. This prevents an accepted FastCGI request from being reset at handoff; diff --git a/scripts/deb/uce.service b/scripts/deb/uce.service index fde74c1..170955a 100644 --- a/scripts/deb/uce.service +++ b/scripts/deb/uce.service @@ -8,6 +8,7 @@ Requires=uce.socket Type=simple WorkingDirectory=/usr/lib/uce RuntimeDirectory=uce +RuntimeDirectoryPreserve=yes StateDirectory=uce CacheDirectory=uce ExecStartPre=/usr/bin/mkdir -p /var/cache/uce/work /var/lib/uce/uploads /var/lib/uce/sessions diff --git a/scripts/systemd/uce.service b/scripts/systemd/uce.service index 30995f5..cc5521f 100644 --- a/scripts/systemd/uce.service +++ b/scripts/systemd/uce.service @@ -8,6 +8,7 @@ Requires=uce.socket Type=simple WorkingDirectory=/Code/uce.openfu.com/uce RuntimeDirectory=uce +RuntimeDirectoryPreserve=yes StateDirectory=uce CacheDirectory=uce ExecStartPre=/usr/bin/mkdir -p /var/cache/uce/work /var/lib/uce/uploads /var/lib/uce/sessions