Subject: Re: disabling kernel locking

From: [email-masked] (Stephen R. van den Berg)
Date: Mon, 13 Sep 1993 17:26:25 +0200

David W. Tamkin <[email-masked]> wrote:
>somehow.  (A temporary file in my $MAILDIR didn't get removed -- it had a
>name of the form _????genesis.  Is there a way to get procmail not to use
>those temporary files?  Is it some sort of lockfile that I didn't need
>because my recipes that write to files all have local lockfiles?

Probably.  These _????hostname files are generated by procmail just before
it creates a lockfile or a directory folder entry.  Actually, procmail
"renames" these temporary files into the proper lockfile or folder entry.
Usually these files never remain.  The only way one can stick around is if
either:
	- Procmail got killed by a strange signal (like kill -9).
	- The procmail that created it is still running (hung up on
	  something else).

In your case, I suspect the latter.

>  Was it
>part of the problem?)

Most likely no.  It was a result of the problem though.

>The sysadmin recompiled 2.91 in a safe way and told me to disable all kernel
>locking first before recompiling 2.92 pre 5.  So I uncommented the three

Your sysadmin is partly correct.  The locking methods that usually (I say
usually, because different OSes do it differently) cause problems with
NFS are fcntl() and lockf() locking.  This is because they "work" across
NFS.  Which is of course dependent on the lockdaemon on the other end
(usually, the lockd is buggy).

Normally, autoconf should be able to determine if some lockingmethods are
safe on your system, provided that you give it enough different directories
to work with.  If you know what you are doing, or if you don't trust your
lockdaemon at all (i.e. if you suspect that although it worked during the
lockingtests, that might have been a coincidence), then you can uncomment
these defines.

>appropriate lines in config.h:

>#define NO_fcntl_LOCK		/* uncomment any of these three if you       */
>#define NO_lockf_LOCK		/* definitely do not want procmail to make   */
>#define NO_flock_LOCK		/* use of those kernel-locking methods	     */

>But autoconf.h has only this:

>#define NOfcntl_lock

>and doesn't mention the other two #defines.

Correct.  autoconf.h "only" contains entries if your system is non-ANSI or
non-POSIX.  Since POSIX says:	fcntl() locking is the way to go, fcntl()
locking is the default, and lockf() and flock() locking are "extra".
So, autoconf only mentions that fcntl() locking is unavailable as well.

>  Is it safe to use?

Yes.

>  How can I
>tell?  The man page doesn't seem to list (as far as I can find) which locking
>methods are used.

If some kernel locking methods are employed, "man procmail" should list them
in the NOTES section, I believe.  If none, the text is omitted.

-- 
Sincerely,                                  [email-masked]
           Stephen R. van den Berg (AKA BuGless).    [email-masked]

"Good moaning!"