[Pkg-mailman-hackers] various issues

GCS gcs-guest@users.alioth.debian.org
Mon, 23 Feb 2004 23:07:45 +0100


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

On Sun, Feb 22, 2004 at 01:58:46PM +0100, Tollef Fog Heen <tfheen@raw.no> wrote:
> | More on this topic IMHO #204006 can be merged into #231468 as basically
> | it seems to be the same bug. Latter has a patch, but it would be much
> | better to wait for the process to finish and not a fixed amount of time.
> | It can be accomplished by using start-stop-daemon, with the stop action
> | we could use --retry.
> 
> Yup; care to fix?
 I was wrestling with it, and still does not like it. The problem lies
in the interpreter fork. You start $DAEMON, but it will show up as
'/usr/bin/python $DAEMON' in ps' output. I could start it with
start-stop-daemon, but not stop, as it was confused by the python
interpreter prefix (-n didn't help). I may overcome this situation with
'start-stop-daemon --start --quiet --oknodo --exec $DAEMON stop'
but it's a bit ugly using the start feature for stopping the daemon.
Also, made it impossible to implement restart because --retry only works
with --stop. The best I could come up is specifing $INTERPRETER to
python, test with -x as well. Now start/stop/reload/restart works, only
stop does not print out the 'Shutting down' message. It can be because
--stop sends a signal as well, and it stops the daemon before it can
print out the message.
See the attached file for the changes. It may be committed, but I ask
for your word, and we should find out how can we get back the message on
stop.

Cheers,
GCS

--dDRMvlgZJXvWKvBx
Content-Type: text/plain; charset=iso-8859-2
Content-Disposition: attachment; filename=mailman

#! /bin/sh
#
# mailman	starts up the qrunner for mailman

#               Based on skeleton, by those listed below.  Customizations 
#               done by Tollef Fog Heen <tfheen@debian.org>
#
#		Written by Miquel van Smoorenburg <miquels@cistron.nl>.
#		Modified for Debian GNU/Linux
#		by Ian Murdock <imurdock@gnu.ai.mit.edu>.
#
# Version:	@(#)skeleton  1.9.1  08-Apr-2002  miquels@cistron.nl
#

PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
INTERPRETER=/usr/bin/python
DAEMON=/usr/lib/mailman/bin/mailmanctl
PIDFILE=/var/lib/mailman/data/master-qrunner.pid
NAME=mailman
DESC="mailman queue runner"

test -x $INTERPRETER || exit 0
test -x $DAEMON || exit 0

set -e

case "$1" in
  start)
        if [ "$(/var/lib/mailman/bin/list_lists -b | grep ^mailman$ )" = "" ]; then
            echo "Site list for mailman (usually named mailman) missing"
            echo "Please create it; until then, mailman will refuse to start"
            exit 0
        fi
        start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $INTERPRETER $DAEMON -- -s start
	echo "."
	;;
  stop)
        start-stop-daemon --stop --retry 5 --pidfile $PIDFILE --exec $INTERPRETER $DAEMON stop
	echo "."
	;;
  reload)
	#
	#	If the daemon can reload its config files on the fly
	#	for example by sending it SIGHUP, do it here.
	#
	#	If the daemon responds to changes in its config file
	#	directly anyway, make this a do-nothing entry.
	#
	echo -n "Reloading $DESC configuration..."
	start-stop-daemon --start --quiet --oknodo --exec $INTERPRETER $DAEMON restart
	 echo "done."
  ;;
  restart|force-reload)
	#
	#	If the "reload" option is implemented, move the "force-reload"
	#	option to the "reload" entry above. If not, "force-reload" is
	#	just the same as "restart".
	#
	echo -n "Restarting $DESC: $NAME"
        start-stop-daemon --stop --quiet --retry 5 --pidfile $PIDFILE --exec $INTERPRETER $DAEMON stop
        start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $INTERPRETER $DAEMON -- -s start
	echo "."
	;;
  *)
	N=/etc/init.d/$NAME
	# echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
	echo "Usage: $N {start|stop|restart|force-reload}" >&2
	exit 1
	;;
esac

exit 0

--dDRMvlgZJXvWKvBx--