[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Transitioning from existence-based lockfiles and /var/lock to flock



Josh Triplett <josh@joshtriplett.org> writes:

> - Software should not use existence-based lockfiles (where the existence
>   of the lockfile constitutes holding the lock); software should use
>   file-based locking (`flock`) on an appropriate file instead.
> - Where possible, software should apply `flock` to an appropriate target
>   file rather than a dedicated lockfile. For instance, if locking a
>   device or a data file, software should `flock` the device file or data
>   file, rather than creating a separate file to lock.

Way back in the day, it used to matter whether you used flock or fcntl and
one type of lock was potentially invisible to the other type of lock. Has
this been fixed, or is that still a concern?

This otherwise looks good to me. Could you open a Policy bug?

-- 
Russ Allbery (rra@debian.org)              <https://www.eyrie.org/~eagle/>


Reply to: