[Pkg-mailman-hackers] Pkg-mailman commit - rev 731 - trunk/debian

Thorsten Glaser tg at alioth.debian.org
Sun Sep 23 20:12:26 UTC 2012


Author: tg
Date: 2012-09-23 20:12:26 +0000 (Sun, 23 Sep 2012)
New Revision: 731

Modified:
   trunk/debian/changelog
   trunk/debian/mailman.init
Log:
prevent ugly error messages when starting and there are many lists:

root at evolvis:~ # /etc/init.d/mailman start
close failed in file object destructor:
sys.excepthook is missing
lost sys.stderr
Starting Mailman master qrunner: mailmanctl.

This is because ?\226?\128?\156grep -q?\226?\128?\157 closes its input as soon as it?\226?\128?\153s got a match,
but Python had not yet written everything to its stdout. Work around it
by reading everything then comparing.

Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog	2012-06-18 15:26:34 UTC (rev 730)
+++ trunk/debian/changelog	2012-09-23 20:12:26 UTC (rev 731)
@@ -1,3 +1,9 @@
+mailman (1:2.1.15-2) UNRELEASED; urgency=low
+
+  * Prevent losing stderr in the init script when there are many lists.
+
+ -- Thorsten Glaser <tg at mirbsd.de>  Sun, 23 Sep 2012 22:11:28 +0200
+
 mailman (1:2.1.15-1) unstable; urgency=low
 
   * New upstream release.

Modified: trunk/debian/mailman.init
===================================================================
--- trunk/debian/mailman.init	2012-06-18 15:26:34 UTC (rev 730)
+++ trunk/debian/mailman.init	2012-09-23 20:12:26 UTC (rev 731)
@@ -44,15 +44,21 @@
 	exit 0;
 fi
 
+# Just a newline.
+nl='
+'
+
 case "$1" in
   start)
     SITE_LIST=$( sed -rne "s/^[[:space:]]*MAILMAN_SITE_LIST[[:space:]]*=[[:space:]]*(['\"])([^'\"]+)\\1/\\2/p" /etc/mailman/mm_cfg.py )
     [ -n "$SITE_LIST" ] || SITE_LIST='mailman'
-    if ! /var/lib/mailman/bin/list_lists -b | grep -q "^${SITE_LIST}$"; then
+    case "$nl$(/var/lib/mailman/bin/list_lists -b)" in
+    (*$nl$SITE_LIST$nl*) ;;
+    (*)
         log_warning_msg "Site list for mailman missing (looking for list named '${SITE_LIST}')."
         log_warning_msg "Please create it; until then, mailman will refuse to start."
-        exit 0;
-    fi
+        exit 0 ;;
+    esac
     log_daemon_msg "Starting Mailman master qrunner" "mailmanctl"
     if $DAEMON -s -q start; then
         log_end_msg 0




More information about the Pkg-mailman-hackers mailing list