Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions bin/agbox
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,11 @@ preflight() {
os_is_supported || log_warn "$OS_PRETTY is not tested; continuing anyway"

# One agbox at a time (e.g. first-boot unit vs. a manual run).
if has_cmd flock && [[ -w /run/lock ]]; then
exec {_lock_fd}>/run/lock/agbox.lock
# Open read-only: the lock file may belong to another user (root's first-boot
# run), and protected_regular forbids O_CREAT on it in the sticky /run/lock.
local lock=/run/lock/agbox.lock
if has_cmd flock && [[ -w /run/lock ]] && { [[ -e $lock ]] || : >"$lock"; } 2>/dev/null; then
exec {_lock_fd}<"$lock"
flock -n "$_lock_fd" || die "another agbox run is in progress"
fi
}
Expand Down
Loading