Skip to content

Add single-instance enforcement#460

Merged
PhilipK merged 1 commit intoPhilipK:mainfrom
d-b-c-e:feature/single-instance
Feb 2, 2026
Merged

Add single-instance enforcement#460
PhilipK merged 1 commit intoPhilipK:mainfrom
d-b-c-e:feature/single-instance

Conversation

@d-b-c-e
Copy link
Contributor

@d-b-c-e d-b-c-e commented Feb 2, 2026

Summary

  • Create src/single_instance.rs with lock file + PID checking mechanism
  • Prevent multiple BoilR instances from running simultaneously
  • Uses the existing sysinfo dependency for cross-platform process detection
  • Lock file stored at config folder (boilr.lock), cleaned up on exit

How it works

On startup, BoilR creates a lock file containing its PID. If a lock file already exists, it checks whether the process is still alive. If it is, BoilR exits with a message. If the old process is gone (stale lock), it takes over the lock.

Test plan

  • Build succeeds
  • First instance starts normally
  • Second instance shows error message and exits
  • After closing first instance, a new one can start

🤖 Generated with Claude Code

Prevent multiple BoilR instances from running simultaneously using a
lock file with PID checking. This avoids potential data corruption
when two instances try to modify Steam shortcuts concurrently.

The lock file is stored in the config folder (boilr.lock) and
contains the PID of the running instance. On startup, if a lock file
exists, we check whether the process is still alive using sysinfo
before deciding to block or take over the lock.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@PhilipK PhilipK merged commit ecb18d7 into PhilipK:main Feb 2, 2026
4 checks passed
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.

2 participants