Bug 4272 - sendmail/rpm/elm locking issues
Summary: sendmail/rpm/elm locking issues
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: nfs-utils
Version: 7.0
Hardware: i386
OS: Linux
Target Milestone: ---
Assignee: Michael K. Johnson
QA Contact:
: 4382 4383 (view as bug list)
Depends On:
TreeView+ depends on / blocked
Reported: 1999-07-30 16:00 UTC by tpavlic
Modified: 2008-05-01 15:37 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2003-01-24 18:15:57 UTC

Attachments (Terms of Use)

Description tpavlic 1999-07-30 16:00:04 UTC
The elm that comes with RedHat 6.0 looks like it has not
been compiled with fcntl support.

The Linux 2.0.x (and below) kernels had a special flock
routine that allowed for flocking on NFS shares.

The Linux 2.1.x (and above) kernels implement correct
locking, where flock is used with local filesystems and
fcntl for remote shares.

If a program was compiled with the older libraries on a
system running the old kernels, it will not lock correctly
on NFS shares on a newer kernel with the new libraries. In
this case, the program needs to be recompiled with the new

This is exaclty the case with elm. It works fine as long as
your spool directory is mounted local. If a spool directory
is NFS mounted, (as quite a few are) elm will not be able
to do file locking. In fact, it will startup and complain
that it can't flock as there are no locks available.
Recompiling elm on a RedHat 6.0 system fixes the problem.

Please release an updated RPM with the recompiled elm. (as
well as any new 2.5.0-0.2pre8 patches) If such action is
not taken, anyone who has an NFS mounted mailspool will not
be able to use elm unless they recompile themselves.

Be sure there are no other programs that may also have
problems with flock and fcntl.

Comment 1 Jeff Johnson 1999-08-31 17:25:59 UTC
The recompiled elm-2.5.1-1 still has problems locking on NFS mounted
/var/spool/mail from solaris2.6 even though an strace shows that only
fcntl locking is being used in the binary.

Comment 2 Jeff Johnson 1999-08-31 23:34:59 UTC
*** Bug 4382 has been marked as a duplicate of this bug. ***

sendmail looks to have been compiled using the old file
locking emulation from the old pre-2.2.x libraries. 2.2.x
(2.1.x+) have completely gotten rid of the old file locking
emulation and now use real BSD file locking. Because of
this, sendmail (and any other program compiled with the old
routines) will not be able to get any locks on an NFS

Please recompile sendmail with the new libraries. rpm and
elm are two other examples of this same problem.

Comment 3 Jeff Johnson 1999-08-31 23:35:59 UTC
*** Bug 4383 has been marked as a duplicate of this bug. ***

rpm looks like it has been compiled with the old file
locking routines from the pre-2.1.x libraries. Because of
this, it cannot write to any of my NFS shares.

This is becoming a very tedious problem. This is the
*THIRD* program I've found in RH6.0 that has not been
compiled with the RH6.0 libraries! sendmail and elm are the
two other programs. I had to recompile them myself in order
to get them to work. (elm wouldn't work at all -- sendmail
would cause a lockd error every time it sent mail)

If you'd like an easy example of what I'm talking about,
using the elm that comes with RH6.0, on an RH6.0 system,
mount a spool directory via NFS. On the system on which the
NFS share is mounted, run elm. Elm will not be able to get
any locks. Recompile elm and it will be able to read mail
just fine.

Elm is not a big deal, but sendmail and rpm are. Please
release updates to all of your programs that are not
compiled with the new locking routines.

------- Additional Comments From jbj@redhat.com  08/06/99 13:24 -------

*** Bug 4393 has been marked as a duplicate of this bug. ***

In order for RPM to correctly read and write to and from
NFS shres, it needs to be recompiled. The 2.2.x kernel and
the newest libraries have done away with the old file
locking routines. Any program compiled with the old flock
emulation (which has been now COMPLETELY replaced by real
BSD file locking) needs to be recompiled with the new
libraries in order to do locking correclty on NFS shares.
Without recompiling those programs, they will not be able
to lock on an NFS share and usually won't be able to read
or write from or to them.

I've had this problem with elm and sendmail and now rpm.
(I've also had it with non-RedHat stuff like cucipop and
the FrontPage Server Extensions) Everything I recompiled
works fine now, but before I did, it was quite frustrating.

Take a look in the Linux source tree:


for information about the new locking scheme.

This is very important that you release updates to all
programs that have this problem. Professional organizations
use NFS often. It's quite tedious if we have to try and
recompile everything that needs it. (Especially in cases
like sendmail, where compiling requires configuration in
order to produce the appropriate binary that has the same
support as the one installed with the RPM)

Comment 4 Cristian Gafton 2000-08-09 02:34:17 UTC
assigned to johnsonm

Comment 5 Stephen John Smoogen 2003-01-24 18:15:57 UTC
Bug 4272 has been closed because of the major changes between 6.0 and 8.0 in the
kernel, rpm, and file locking over NFS. Red Hat 6.0 is also deprecated and
people using it should at least upgrade to 6.2 to see if the problem is

If the problem can be duplicated in the 8.0 release, please re-open.

Note You need to log in before you can comment on or make changes to this bug.