Re: [Mailman-Users] mailman, postifx, and bsdos3
"GME" == George M Ellenburg <gmelists@caffeine.sundial.net> writes:
GME> At the request of some of my customers, I've recently
GME> installed mailman on BSD 3.1, with Postfix beta-19990317-pl02
GME> as the transport.
GME> Frankly, I'm a little confused with regards to the install
GME> instructions. Was wondering if anyone can provide some
GME> elightenment.
GME> I'm getting the following error when trying to create a test list:
| sundial:~/bin $ whoami
| mailman
| sundial:~/bin $ ./newlist
| Enter the name of the list: test
| Enter the email of the person running the list: gme@caffeine.sundial.net
| Initial test password: testpassword
| Traceback (innermost last):
| File "./newlist", line 141, in ?
| raise SystemExit(main(sys.argv))
| File "./newlist", line 91, in main
| newlist.Create(list_name, owner_mail, pw)
| File "/u1/mailman/Mailman/MailList.py", line 658, in Create
| self.Lock()
| File "/u1/mailman/Mailman/MailList.py", line 1213, in Lock
| self._lock_file.lock('w|', 1)
| File "/usr/local/lib/python1.5/posixfile.py", line 190, in lock
| flock = fcntl.fcntl(self._file_.fileno(), cmd, flock)
| IOError: (22, 'Invalid argument')
| sundial:~/bin $
I'm Cc'ing the Mailman developers and Guido on this message, because I suspect there's a problem with your Python on your operating system (BSD 3.1). For some reason lock() method on the posixfile object is failing. This method eventually calls down to fcntl() and the `|' modifier translates to F_SETLKW. fcntl(2) says that this could fail and return EINVAL (i.e. errno 22) as described in my Solaris manpage:
EINVAL The cmd argument is invalid; or the cmd argu-
ment is F_DUPFD and arg is negative or
greater than or equal to OPEN_MAX; or the cmd
argument is F_GETLK, F_GETLK64, F_SETLK,
F_SETLK64, F_SETLKW, or F_SETLKW64 and the
data pointed to by arg is not valid; or
fildes refers to a file that does not support
locking.
I've never seen this happen before, at least in the context of Mailman, so that's why I'm suspecting your OS, of which I have no experience. What does your sys.platform say? Maybe someone else has some idea about why this is failing.
-Barry
The mention of posixfile, fcntl and BSD made me remember something. There's some very non-portable code that constructs the fcntl call. The CVS archives have a version of posixfile.py that is newer than that in the Python 1.5.2b2 release, and the CVS log comment says:
| According to Jeffrey Honig, bsd/os 2.0 - 4.0 should be added to the | list (of bsd variants that have a different lock structure).
Here's the patch:
Index: posixfile.py
RCS file: /projects/cvsroot/python/dist/src/Lib/posixfile.py,v retrieving revision 1.10 retrieving revision 1.11 diff -c -r1.10 -r1.11 *** posixfile.py 1998/03/26 21:12:38 1.10 --- posixfile.py 1999/02/23 04:14:32 1.11
*** 177,183 ****
# Hack by davem@magnet.com to get locking to go on freebsd;
# additions for AIX by Vladimir.Marangozov@imag.fr
import sys, os
! if sys.platform in ('netbsd1', 'freebsd2', 'freebsd3'):
flock = struct.pack('lxxxxlxxxxlhh',
l_start, l_len, os.getpid(), l_type, l_whence)
elif sys.platform in ['aix3', 'aix4']:
--- 177,185 ----
# Hack by davem@magnet.com to get locking to go on freebsd;
# additions for AIX by Vladimir.Marangozov@imag.fr
import sys, os
! if sys.platform in ('netbsd1',
! 'freebsd2', 'freebsd3',
! 'bsdos2', 'bsdos3', 'bsdos4'):
flock = struct.pack('lxxxxlxxxxlhh',
l_start, l_len, os.getpid(), l_type, l_whence)
elif sys.platform in ['aix3', 'aix4']:
*** 190,196 **** flock = fcntl.fcntl(self._file_.fileno(), cmd, flock)
if '?' in how:
! if sys.platform in ('netbsd1', 'freebsd2', 'freebsd3'):
l_start, l_len, l_pid, l_type, l_whence =
struct.unpack('lxxxxlxxxxlhh', flock)
elif sys.platform in ['aix3', 'aix4']:
--- 192,200 ----
flock = fcntl.fcntl(self._file_.fileno(), cmd, flock)
if '?' in how:
! if sys.platform in ('netbsd1',
! 'freebsd2', 'freebsd3',
! 'bsdos2', 'bsdos3', 'bsdos4'):
l_start, l_len, l_pid, l_type, l_whence =
struct.unpack('lxxxxlxxxxlhh', flock)
elif sys.platform in ['aix3', 'aix4']:
--Guido van Rossum (home page: http://www.python.org/~guido/)
participants (2)
-
Barry A. Warsaw
-
Guido van Rossum