[Pkg-mailman-hackers] Bug#440323: Ability to change the niceness of the mailman process group

Peter Rabbitson rabbit+bugs at rabbit.us
Fri Aug 31 14:59:13 UTC 2007


Package: mailman
Version: 1:2.1.9-8
Severity: minor
Tags: patch


My mailman installation is quite large and it is really desirable to modify
the priority so the server can do something else in the meantime. This patch to
the init script does precisely this. Feel free to include in the official 
package if you find this useful.
-------------- next part --------------
--- mailman.original	2007-06-11 14:47:33.000000000 -0400
+++ mailman	2007-08-31 10:48:40.000000000 -0400
@@ -22,6 +22,8 @@
 PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
 DAEMON=/usr/lib/mailman/bin/mailmanctl
 PIDFILE=/var/lib/mailman/data/master-qrunner.pid
+NICED=yes
+NICED_LEVEL=15
 
 test -x $DAEMON || exit 0
 
@@ -44,6 +46,13 @@
 	exit 0;
 fi
 
+if [ "$NICED" = "yes" ] ; then
+    NICE_CMD="/usr/bin/nice"
+    if [ "$NICED_LEVEL" ] ; then
+        NICE_CMD="$NICE_CMD --adjustment=$NICED_LEVEL"
+    fi
+fi
+
 case "$1" in
   start)
     if [ "$(/var/lib/mailman/bin/list_lists -b | grep ^mailman$ )" = "" ]; then
@@ -52,7 +61,7 @@
         exit 0;
     fi
     log_daemon_msg "Starting Mailman master qrunner" "mailmanctl"
-    if $DAEMON -s -q start; then
+    if $NICE_CMD $DAEMON -s -q start; then
         log_end_msg 0
     else
         log_end_msg 1
@@ -90,7 +99,7 @@
             log_action_end_msg 0
         fi
     fi
-    if $DAEMON -q start; then
+    if $NICE_CMD $DAEMON -q start; then
         log_end_msg 0
     else
         log_end_msg 1


More information about the Pkg-mailman-hackers mailing list