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

RFC: locking policy for Debian



Hi folks!

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
/etc/passwd.

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
correct?

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 (miquels@cistron.nl) 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
find it. 

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.

Thanks,

Chris

--                 Christian Schwarz
Do you know         schwarz@monet.m.isar.de, schwarz@schwarz-online.com,
Debian GNU/Linux?    schwarz@debian.org, schwarz@mathematik.tu-muenchen.de
      
Visit                  PGP-fp: 8F 61 EB 6D CF 23 CA D7  34 05 14 5C C8 DC 22 BA
http://www.debian.org   http://fatman.mathematik.tu-muenchen.de/~schwarz/


--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
debian-devel-request@lists.debian.org . 
Trouble?  e-mail to templin@bucknell.edu .


Reply to: