bug: stale PID file prevents cobot restart after crash/kill #136

Closed
opened 2026-02-27 10:53:39 +00:00 by Zeus · 0 comments
Collaborator

Bug

When cobot is killed (SIGKILL, crash, or system restart), the PID file at ~/.cobot/cobot.pid is not cleaned up. On next start, cobot sees the stale PID and refuses to start:

Cobot already running (PID 1027294)
Use 'nano restart' to restart or kill the process first.

Steps to Reproduce

  1. Start cobot
  2. Kill with kill -9 or let it crash
  3. Try to restart — blocked by stale PID file
  4. Must manually rm ~/.cobot/cobot.pid

Expected

Cobot should check if the PID in the file is actually alive (kill -0) before refusing to start. If the process is dead, remove the stale PID file and proceed.

## Bug When cobot is killed (SIGKILL, crash, or system restart), the PID file at `~/.cobot/cobot.pid` is not cleaned up. On next start, cobot sees the stale PID and refuses to start: ``` Cobot already running (PID 1027294) Use 'nano restart' to restart or kill the process first. ``` ## Steps to Reproduce 1. Start cobot 2. Kill with `kill -9` or let it crash 3. Try to restart — blocked by stale PID file 4. Must manually `rm ~/.cobot/cobot.pid` ## Expected Cobot should check if the PID in the file is actually alive (`kill -0`) before refusing to start. If the process is dead, remove the stale PID file and proceed.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
ultanio/cobot#136
No description provided.