From d9bde195cdc25972ff56b23aced933930b883f73 Mon Sep 17 00:00:00 2001 From: Lance Walters Date: Mon, 16 Nov 2026 20:41:20 -0500 Subject: [PATCH] apps(forgejo): clear stale dind pid on start so runner restarts self-heal The dind container mounts the dind-run emptyDir at /var/run. A reboot restarts the container inside the same pod, so that emptyDir keeps the dead daemon's docker.pid; dockerd then aborts with "process with PID N is still running" and the runner sits in CrashLoopBackOff until someone deletes the pod. Removing the stale pid and socket before starting dockerd makes both the amd64 and arm64 runners recover on their own. --- apps/base/forgejo/runner-amd64.yaml | 7 +++++++ apps/base/forgejo/runner-arm64.yaml | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/apps/base/forgejo/runner-amd64.yaml b/apps/base/forgejo/runner-amd64.yaml index 44e9008..cdadc0d 100644 --- a/apps/base/forgejo/runner-amd64.yaml +++ b/apps/base/forgejo/runner-amd64.yaml @@ -76,6 +76,13 @@ spec: - sh - -c - | + # A reboot restarts this container inside the same pod, so the + # dind-run emptyDir keeps the previous daemon's pid file. dockerd + # then refuses to start ("process with PID N is still running") + # and the runner crashloops until the pod is deleted by hand. + # Clear the stale runtime state first so a restart is + # self-healing. + rm -f /var/run/docker.pid /var/run/docker.sock dockerd --host=unix:///var/run/docker.sock --tls=false --mtu=1420 & pid=$! i=0 diff --git a/apps/base/forgejo/runner-arm64.yaml b/apps/base/forgejo/runner-arm64.yaml index 74d2e5a..bb66a61 100644 --- a/apps/base/forgejo/runner-arm64.yaml +++ b/apps/base/forgejo/runner-arm64.yaml @@ -46,6 +46,13 @@ spec: - sh - -c - | + # A reboot restarts this container inside the same pod, so the + # dind-run emptyDir keeps the previous daemon's pid file. dockerd + # then refuses to start ("process with PID N is still running") + # and the runner crashloops until the pod is deleted by hand. + # Clear the stale runtime state first so a restart is + # self-healing. + rm -f /var/run/docker.pid /var/run/docker.sock # --insecure-registry: the Pi registry is plain HTTP on the WG # hub IP. Docker only treats 127.0.0.0/8 as insecure by default, # so without this `docker push 10.10.0.1:5000/...` from a job