Article View: comp.emacs
Article #7952movemail and file locking
From: Dale Worley
Date: Wed, 23 Nov 1988 15:13
Date: Wed, 23 Nov 1988 15:13
23 lines
1473 bytes
1473 bytes
Do be careful when you're dealing with movemail! The problem is that there are two completely different methods that sendmail uses to interlock mail handling (depending on your system type), and movemail must use that method also. This is controlled by MAIL_USE_FLOCK. If it's defined, movemail uses the flock() system call to interlock, and if it's not, movemail creates lock files. If you're using flock(), movemail needn't be setuid. As far as I know, BSD systems use flock, and System V systems use lock files. Unfortunately, in NFS (or at least, Sun NFS), the flock() call is not system-wide, it is only known on the local host. Sun did provide the lockf() call which is system-wide, so you have to do your locking different ways depending on what sort of file system you've got. And as far as I can tell, you can't use lockf to fake up a system-wide flock, since they are inherited differently by child processes. Yuck. Also, apropos complaints about Emacs's locking files being edited -- perhaps they should be implemented using flock (or lockf) on systems that support it? This solves the clean-up problem. Dale
Technical Details
Message-ID:
<8811231513.AA13214@galaxy.compass.com>Path:
arc1-ca.pugleaf.net!utzoo!attcan!uunet!eplrx7!udel!princeton!njin!rutgers!mit-eddie!compass.UUCP!worleyShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!eplrx7!udel!princeton!njin!rutgers!mit-eddie!compass.UUCP!worley From: worley@compass.UUCP (Dale Worley) Newsgroups: comp.emacs Subject: movemail and file locking Message-ID: <8811231513.AA13214@galaxy.compass.com> Date: 23 Nov 88 15:13:02 GMT Sender: nessus@eddie.MIT.EDU Lines: 23