Skip to content

fix(pid): (updated) verify gateway identity before blocking startup on stale PID#2813

Open
mrigangha wants to merge 5 commits intosipeed:mainfrom
mrigangha:fix/stale-pid-process
Open

fix(pid): (updated) verify gateway identity before blocking startup on stale PID#2813
mrigangha wants to merge 5 commits intosipeed:mainfrom
mrigangha:fix/stale-pid-process

Conversation

@mrigangha
Copy link
Copy Markdown

@mrigangha mrigangha commented May 7, 2026

📝 Description

The singleton check in WritePidFile only verified that a process with the
recorded PID existed, but did not verify it was actually a picoclaw gateway.
When a gateway crashed without cleaning up its PID file and the OS reused
that PID for an unrelated process (e.g. systemd-resolved), the gateway would
refuse to start and enter a crash loop under systemd.

🗣️ Type of Change

  • 🐞 Bug fix (non-breaking change which fixes an issue)
  • ✨ New feature (non-breaking change which adds functionality)
  • 📖 Documentation update
  • ⚡ Code refactoring (no functional changes, no api changes)

🤖 AI Code Generation

  • 🤖 Fully AI-generated (100% AI, 0% Human)
  • 🛠️ Mostly AI-generated (AI draft, Human verified/modified)
  • 👨‍💻 Mostly Human-written (Human lead, AI assisted or none)

🔗 Related Issue

Fixes #2720

📚 Technical Context (Skip for Docs)

  • Reference URL:
  • Reasoning:

🧪 Test Environment

  • Hardware: PC
  • OS: Ubuntu 22.04

☑️ Checklist

  • My code/docs follow the style of this project.
  • I have performed a self-review of my own changes.
  • I have updated the documentation accordingly.

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.

[BUG] Singleton PID check doesn't verify process identity — stale PID causes crash loop

1 participant