Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

8
  • @pLumo I think flock is the answer, but that question does not tell me how to actually use it to accomplish my goal of synchronous appending writes. Commented May 26, 2020 at 12:22
  • linux.die.net/man/1/lockfile also seems promising. Commented May 26, 2020 at 12:39
  • @HappyFace, isn't that linked question just about the same situation? You're appending to a file, and they're not but other than that it's the same, locking a file for just a single concurrent process at a time? Commented May 26, 2020 at 13:25
  • 1
    also I don't think the kill -9 should matter. the lock is associated with the open file description, and if the process dies, the fd closes and the lock is gone Commented May 26, 2020 at 13:26
  • @ilkkachu True, we can close this question. Commented May 26, 2020 at 13:27