[Mailman-Users] Lock files and withlist?

Adrian Wells adrian at whatifnet.com
Thu Sep 15 18:40:55 CEST 2005


Hello.  I'm working with Mailman 2.1.6 and learning about the helpful
withlist tool.  Disclaimer, I'm learning more about Python and Mailman so
it's very likely, I've made a fairly simple error.  I've written a couple
scripts to make changes to a number of lists (like changing a number of
list's hostname or list owner).  For example:

customchange.py is located at the root installation directory of Mailman. 
It contains:

# Python function to make custom changes
def customchange(m):
    curlist = m.real_name
    curlist = curlist.lower()
    print 'Current list is: ' + curlist
    if curlist.startswith('apples'):
         print 'Starts with apples!  Current host_name is: ' + m.host_name
         print 'Changing hostname now...'
         m.host_name = 'lists.newlistname.org'
         m.Save()


This script is then run with withlist:

./withlist -a -l -r customchange


After preforming this, I noticed that the web interface for lists are not
accessible and that the locks directory contains at least two lock files
for every list.  For example a list called 'defaultdomain' contains the
following lock files similar to this:

-rw-rw-r--  2 adrian  mailman 73 Sep 15  2005 defaultdomain.lock
-rw-rw-r--  1 mailman mailman 73 Sep 15  2005
defaultdomain.lock.lists.newlistname.org.20587.0


I've also noticed that these lock files appear to be cleared out the next
day when cron/checkdbs is run at 8 AM.  The locks log contains entries
such as this (I realize the dates don't match the above example but the
results are the same for all lists):

Sep 14 08:00:07 2005 (17702) defaultdomain.lock lifetime has expired,
breaking
Sep 14 08:00:07 2005 (17702)   File "/Users/mailman/cron/checkdbs", line
178, in ?
Sep 14 08:00:07 2005 (17702)     main()
Sep 14 08:00:07 2005 (17702)   File "/Users/mailman/cron/checkdbs", line
84, in main
Sep 14 08:00:07 2005 (17702)     mlist = MailList.MailList(name)
Sep 14 08:00:07 2005 (17702)   File "/Users/mailman/Mailman/MailList.py",
line 126, in __init__
Sep 14 08:00:07 2005 (17702)     self.Lock()
Sep 14 08:00:07 2005 (17702)   File "/Users/mailman/Mailman/MailList.py",
line 159, in Lock
Sep 14 08:00:07 2005 (17702)     self.__lock.lock(timeout)
Sep 14 08:00:07 2005 (17702)   File "/Users/mailman/Mailman/LockFile.py",
line 306, in lock
Sep 14 08:00:07 2005 (17702)     important=True)
Sep 14 08:00:07 2005 (17702)   File "/Users/mailman/Mailman/LockFile.py",
line 416, in __writelog
Sep 14 08:00:07 2005 (17702)     traceback.print_stack(file=logf)

If someone could help me to understand what is happening and/or how to
avoid this from happening, I would appreciate it.  Also, is there a
safe/recommended method to remove the lock files so the lists can be used
again?  Thank you,
-Adrian




More information about the Mailman-Users mailing list