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

Re: File Locking

On 18 Jun 1997, Karl M. Hegbloom wrote:

>     Christian> On 16 Jun 1997, Karl M. Hegbloom wrote:
>     >> ** Publib looks like it might already be the library needing to
>     >> be created that was mentioned earlier... or at least a very
>     >> good start.
>     Christian> Thanks for pointing that out! I just had a look at
>     Christian> "publib" and the "lockfile.c" is really very
>     Christian> concrete. (There is no documentation, though :-( )
>  No documentation?  Sure there is.  There's a manual page for every
> function in the libc, and if you've got Emacs or XEmacs, and
> `libc-mode', you can look up the docs in the TeXinfo with a few
> keypushes.  To read a manual page, just type {M-x man ENTER} and the
> name of the manual you want.  It defaults to the word the cursor was
> on.

But "lockfile.c" is in "public", not in "libc"!

>  I wonder, should it utilize libuuid in some way?  (I've a lot of
> reading to do...)  It seems that what should happen is that when a
> lockfile is made, inside it should be the `sysid' of the computer
> creating the lock, as well as the PID of the process on that computer.

Of course, that would be nice.

>  I think the real way is for the `flock' structure, (through
> <fcntl.h>) to contain a l_sysid field.  With that, the kernel will
> have a place to keep track of which machine holds the lock on a file.
> It should be supported by the kernel-level nfs system, so that a
> normal `flock', `fcntl', or `lockf' will work across nfs, without the
> need for a dotfile kludge-hammer.  I really need to read a lot more
> about this type of thing.  I've a feeling it will built into the next
> major kernel release.

Unfortunately, this won't help us a bit. We have to use a locking
mechanism which not only works between Debian/Linux systems, but also
between other systems. Just consider someone running a Solaris box as NFS
server with some sendmail version and a Debian system as client to read
the mails.

Thus, if Linux has a working "flock" (over NFS) this will not help us!

>     >> I am doubtful of my own ability to be of much help...  I'd like
>     >> to see what gets done by the programmer though.
>     Christian> If you are intrested in doing it, we don't care if you
>     Christian> have experience or not :-)
> Ok, I'll try.  I can learn as we go.  I know how to use XEmacs and CVS
> a little bit.  (That's what I've been wasting my time on, instead of
> doing math homework or ...)


I'll help you with getting started. There will also be some Policy related
work to do for me.

>  I just saw the upload announcement for the latest `procmail' and
> `smartlist' packages, and see that they have both just been GPL'd.
> That means we can utilize the locking and `robustness' code from them,
> methinks...


>  So, mainly, we need to put together a quick `liblockfile.so', and
> then create a perl interface to it?  Hmmm.  I wonder if SWIG would do
> that easily enough?

I now Perl too, so I can take that part or help you with it. Someone else
around here mentioned--hey! I just discovered that the Perl code I've here
was written be you! Ok, this part seams to be ready. :-) We just have to
make sure it is compatible to our C version.

So, I suggest we continue this discussion in private mail now and come
back when we have a question or something finished. If someone is
intrested in helping us or just wants to check what we're working on, feel
free to email us.



--                  Christian Schwarz
                   schwarz@monet.m.isar.de, schwarz@schwarz-online.com
                  schwarz@debian.org, schwarz@mathematik.tu-muenchen.de
                PGP-fp: 8F 61 EB 6D CF 23 CA D7  34 05 14 5C C8 DC 22 BA
 CS Software goes online! Visit our new home page at

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: