Bug#57284: base: /etc/init.d/arpwatch restart fails
Package: base
Version: 20000207
Severity: normal
Attempting to run the command:
/etc/init.d/arpwatch restart
... fails with a message like: "arpwatch already running"
Clearly we need a delay between the stop and start invocations.
inserting a "sleep 1" command works fine.
This is probably true of number of other daemons.
Re: all init.d scripts:
I'd suggest that the standard template for all daemon starting init.d
scripts be modified to include a set of ARGS to pass to the daemon
a set of arguments as shown in the following example (10th line, and
both instances of --start):
~~~~~~~~~~~~~~~~~~~~~~~~~ Begin Example ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#! /bin/sh
#
# This file was automatically customized by debmake on Mon, 12 Apr 1999 21:32:53 +0200
#
# Written by Miquel van Smoorenburg <miquels@drinkel.ow.org>.
# Modified for Debian GNU/Linux by Ian Murdock <imurdock@gnu.ai.mit.edu>.
# Modified for Debian by Christoph Lameter <clameter@debian.org>
PATH=/bin:/usr/bin:/sbin:/usr/sbin
DAEMON=/usr/sbin/arpwatch
ARGS="-b"
# The following value is extracted by debstd to figure out how to generate
# the postinst script. Edit the field to change the way the script is
# registered through update-rc.d (see the manpage for update-rc.d!)
FLAGS="defaults 50"
test -f $DAEMON || exit 0
case "$1" in
start)
start-stop-daemon --start --verbose --exec $DAEMON -- $ARGS
;;
stop)
start-stop-daemon --stop --verbose --exec $DAEMON
;;
restart|force-reload)
start-stop-daemon --stop --verbose --exec $DAEMON
sleep 1
start-stop-daemon --start --verbose --exec $DAEMON -- $ARGS
;;
*)
echo "Usage: /etc/init.d/arpwatch {start|stop|restart|force-reload}"
exit 1
;;
esac
exit 0
_________________________ End Example __________________________________
-- System Information
Debian Release: potato
Kernel Version: Linux canopus 2.2.14-jimd-fb #4 Mon Feb 7 01:40:25 PST 2000 i586 unknown
Reply to: