[Pkg-mailman-hackers] various issues

GCS gcs-guest@users.alioth.debian.org
Wed, 25 Feb 2004 23:44:33 +0100


--k1lZvvs/B4yU6o8G
Content-Type: text/plain; charset=iso-8859-2
Content-Disposition: inline

On Sun, Feb 22, 2004 at 07:09:34PM +0100, Tollef Fog Heen <tfheen@raw.no> wrote:
> *  (Bernd S. Brentrup)
> | Sounds reasonable to me, but how do you define "obvious"? Apart from
> | typos it's mostly a matter of experience what you consider obvious.
> Changes < 5 lines are (usually) obvious, documentation updates are
> usually obvious.  If in doubt, just ask. :)
 I do ask, as my initscript change is longer than five lines. As I
already written a mail about the ssd problem, I chose not to use it, but
a little loop. See the attachement, please someone proof read it before
commit. I have tested the concept, but who knows, I may have an error
somewhere.

Thanks,
GCS

--k1lZvvs/B4yU6o8G
Content-Type: text/plain; charset=iso-8859-2
Content-Disposition: attachment; filename="mailman-initscript-wait-for-termination.patch"

--- mailman.orig	2004-01-30 11:42:50.000000000 +0100
+++ mailman	2004-02-25 23:56:29.000000000 +0100
@@ -14,6 +14,7 @@
 
 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
 NAME=mailman
 DESC="mailman queue runner"
 
@@ -53,8 +54,24 @@
 	#	option to the "reload" entry above. If not, "force-reload" is
 	#	just the same as "restart".
 	#
+	PID=`cat $PIDFILE 2>/dev/null`
 	echo -n "Restarting $DESC: $NAME"
         $DAEMON stop
+	if test -n "$PID" && kill -0 $PID 2>/dev/null ; then
+		echo -n "Waiting ."
+		cnt=0
+		while [ $cnt -lt 5 ]; do
+			sleep 1
+			kill -0 $PID 2>/dev/null || break
+			cnt=`expr $cnt + 1`
+			echo -n "."
+		done;
+		if kill -0 $PID 2>/dev/null ; then
+			echo " Failed"
+		else
+			echo " Done"
+		fi
+	fi
         $DAEMON start
 	echo "."
 	;;

--k1lZvvs/B4yU6o8G--