Add locking via flock(1) #25
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: tristan/nixinate#25
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "mc/flocking"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
If two Nixinate deployments were executed in parallel, it would cause two activation scripts to run in parallel which can cause failure.
It is not clear whether the correct solution is to use
flock
via Nixinate, or whethernixos-rebuild
or even the activation script should be implementing the locking. Either way, this PR solves the problem from Nixinate's point of view by adding "advisory" file descriptor based locks on the filesystem via/dev/shm
.Also of note is the fact that I have to figure out a way to make
flock
work with thehermetic = true
argument, before it can be merged. Otherwise, it would be a dependency which prevents support for other platforms. It is otherwise an impurity that is expected on the remote side.Helpful references