email redirection question

Jerry Feldman gaf at blu.org
Fri Sep 8 11:06:01 EDT 2006


On Friday 08 September 2006 10:20 am, Paul Lussier wrote:
> Jerry Feldman <gaf at blu.org> writes:
> > I've seen sharing of the  /var/spool/mail directory work reasonably
> > well, especially in a situation where user directories are also
> > exported via NFS.
>
> [...]
>
> > Generally, it is important that the file locking mechanism is
> > consistent.
>
> NFS and file locking?  Aha, ha, ha, ha.  Stop it, you're killing me! :)
>
> Next you'll tell me it's especially good on Linux!
Locking on Unix and Linux is advisory and has been for a number of years. In 
addition, NFS locking has bitten me in the ass, but in a different way. I 
modified the utmp(5) locking mechanism several years ago to use lockf(3). 
However, in a specific case, this would cause init(8) to hang on a diskless 
system because the lockf(3) function requires the lock daemon to be 
running. I subsequently modified it to use flock(2) which has different 
semantics and does not apply locks across networks. I then actually had to 
write my own lock system call in Tru64 Unix because the semantics were 
changing for flock(2) that would cause the same problem that lockf(3) did. 

The problem with locking on Unix and Linux is that the locks are advisory so 
that a misbehaving client can mess things up.  Utmp (et. al) is a real 
problem because it is used by init(8), login(1), telnet, and others. If any 
one of these clients violate the protocol, utmp (and utxtmp) becomes 
compromised. Since we had to comply with standards, this was heavily tested 
in an smp environment, a cluster environment. 

But, in terms of email, not only does the MTA need to properly implement the 
locking protocols, but also the clients, and there are many, many email 
clients on Linux and Unix. 
-- 
Jerry Feldman <gaf at blu.org>
Boston Linux and Unix user group
http://www.blu.org PGP key id:C5061EA9
PGP Key fingerprint:053C 73EC 3AC1 5C44 3E14 9245 FB00 3ED5 C506 1EA9



More information about the gnhlug-discuss mailing list