Skip to content

fix(setup): don't fail when the run lock is owned by root - #2

Merged
antomanc merged 1 commit into
mainfrom
fix/lock-permission
Oct 10, 2026
Merged

antomanc merged 1 commit into
mainfrom
fix/lock-permission

Conversation

@antomanc

Copy link
Copy Markdown
Owner

A lock file left by a root run (e.g. the first-boot unit) is 0644 root:root, so a later run as the normal user failed with:

/usr/local/bin/agbox: line 125: /run/lock/agbox.lock: Permission denied

The lock is now created only if missing and opened read-only (flock works on a read fd). This also avoids fs.protected_regular refusing root's O_CREAT on a user-owned lock in the sticky /run/lock.

https://claude.ai/code/session_01YMswzE32ygHazBu8EfzsdV

…block user runs

A lock file left by a root run (e.g. first-boot unit) is 0644 root:root, so
opening it for writing as the normal user failed with 'Permission denied'.
flock works on a read-only fd; create the file only if it is missing.

Claude-Session: https://claude.ai/code/session_01YMswzE32ygHazBu8EfzsdV
@antomanc
antomanc merged commit 59eee75 into main Oct 10, 2026
5 checks passed
@antomanc
antomanc deleted the fix/lock-permission branch October 10, 2026 12:25
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