RFC: locking policy for Debian
I'm just working on a new Policy manual and discovered that we don't have
a (working) locking policy right now.
AFAIK, this issue came up two times here on debian-devel (about end of Jan
97 and beginning Feb 97) and was about email folder locking and locking of
AFAIK, the only way to lock a file (even reliable over NFS) is to create
another file with a unique filename, e.g. foo.lock-ipaddress-processid,
and create a link say to foo.lock. The "link" function is atomic per
definition, even via NFS and will fail if the file already exists. Is this
I suggest that we
1) document the right way of locking (TM) in our Policy Manual,
2) force _all_ programs touching mail folders, /etc/passwd and alike to
support our way of locking
3) build a "libdebian" package with a shared library that contains a few
functions to lock, unlock, test a file (each program that needs to lock a
file should be linked against this library and call our functions)
4) provide examples for other languages than C (for example Perl)
I just had a look at the old discussion and discovered that Miquel van
Smoorenburg (email@example.com) has already written such a library.
Perhaps we can use his (and adopt it if necessary). If I remember right
someone else posted a Perl example for right file locking--but I can't
Anyways, it would be nice if someone more competent in these things could
provide me a section that I could include in the policy manual.
As always, any comments are appreciated.
-- Christian Schwarz
Do you know firstname.lastname@example.org, email@example.com,
Debian GNU/Linux? firstname.lastname@example.org, email@example.com
Visit PGP-fp: 8F 61 EB 6D CF 23 CA D7 34 05 14 5C C8 DC 22 BA
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
Trouble? e-mail to firstname.lastname@example.org .