Skip to content

Clear stale pcscd socket files on container start#38

Merged
jdoss merged 1 commit intomasterfrom
fix/pcscd-stale-socket
May 3, 2026
Merged

Clear stale pcscd socket files on container start#38
jdoss merged 1 commit intomasterfrom
fix/pcscd-stale-socket

Conversation

@jdoss
Copy link
Copy Markdown
Contributor

@jdoss jdoss commented May 3, 2026

Summary

  • The pcscd container's socket directory (/run/pcscd) is a persistent podman named volume, so pcscd.comm and pcscd.pid survive reboots.
  • pcscd refuses to start when those files exist (Another pcscd seems to be running), fails ten times, and the unit gives up. The HSM cache backend then can't open (no PKCS#11 slot visible), serve falls back to live lookups, and Infisical outages cascade — observed in production on a homelab reboot today.
  • Wrap the pcscd CMD in /bin/sh -c to rm -f the stale files before exec'ing pcscd.

Test plan

  • ruff check / ruff format --check clean
  • Rebuilt pcscd image on homelab, planted stale pcscd.comm and pcscd.pid in the volume, started pcscd: succeeded; previously failed with the stale files present.
  • Next reboot of homelab.inf7.dev comes up without manual recovery.

The pcscd container's socket directory is a persistent podman named
volume, so /run/pcscd/pcscd.comm and pcscd.pid survive reboots. pcscd
refuses to start when those files exist, fails ten times, and gives up,
which knocks out the HSM cache backend and cascades into Infisical
outages on every reboot.

Wrap the CMD in /bin/sh to rm the stale files before exec'ing pcscd.
@jdoss jdoss merged commit 211419f into master May 3, 2026
1 of 2 checks passed
@jdoss jdoss deleted the fix/pcscd-stale-socket branch May 3, 2026 16:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant