From 1551c281c2b7f13747b9b0068ade4295041e7ad7 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 16 Jun 2026 20:36:10 +0000 Subject: [PATCH] fix: move llama-server stderr log from /tmp to working dir (ReadWritePaths compat) The sidecar systemd service has ProtectSystem=strict and ReadWritePaths=/home/bigt/AI/llm, making /tmp read-only. Writing /tmp/llama-server-stderr.log failed with EROFS. Changed LLAMA_STDERR_LOG to os.path.join(dirname(MANIFEST_PATH), ...), resolving to /home/bigt/AI/llm/llama-server-stderr.log, which is within the allowed ReadWritePaths. --- sidecar/app.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sidecar/app.py b/sidecar/app.py index 19e15b3..132f9cd 100644 --- a/sidecar/app.py +++ b/sidecar/app.py @@ -19,7 +19,9 @@ from sidecar.manifest import load_manifest MANIFEST_PATH = os.getenv("MANIFEST_PATH", "/home/bigt/AI/llm/manifest.yaml") SIDECAR_PORT = int(os.getenv("SIDECAR_PORT", "8080")) LLAMA_SERVER_PORT = 8081 -LLAMA_STDERR_LOG = "/tmp/llama-server-stderr.log" +LLAMA_STDERR_LOG = os.path.join( + os.path.dirname(MANIFEST_PATH), "llama-server-stderr.log" +) # Global state _llama_server_process: Optional[asyncio.subprocess.Process] = None @@ -128,6 +130,9 @@ async def _poll_llama_server_ready(max_retries: int = 60, interval: float = 0.5) pass await asyncio.sleep(interval) + # Flush and close the stderr handle so all data is on disk before we read + _close_stderr_log() + # ── Dump stderr for diagnosis ────────────────────────────────────── print("llama-server did NOT become ready — dumping stderr:", flush=True) try: