diff options
Diffstat (limited to 'net-analyzer/arpwatch/files/arpwatch.init')
-rw-r--r-- | net-analyzer/arpwatch/files/arpwatch.init | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/net-analyzer/arpwatch/files/arpwatch.init b/net-analyzer/arpwatch/files/arpwatch.init index bff9abeef761..f4c45bf90a9c 100644 --- a/net-analyzer/arpwatch/files/arpwatch.init +++ b/net-analyzer/arpwatch/files/arpwatch.init @@ -1,7 +1,7 @@ #!/sbin/runscript # Copyright 1999-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/net-analyzer/arpwatch/files/arpwatch.init,v 1.9 2006/09/08 10:44:00 pva Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-analyzer/arpwatch/files/arpwatch.init,v 1.10 2007/02/01 21:09:13 jokey Exp $ depend() { need net @@ -12,21 +12,25 @@ start() { do ebegin "Starting arpwatch on ${IFACE}" DATAFILE=/var/lib/arpwatch/${IFACE}.dat - if [ ! -f ${DATAFILE} ]; then - touch ${DATAFILE} - fi + [ ! -f ${DATAFILE} ] && touch ${DATAFILE} + if [ -z ${ARPUSER} ]; then - setsid /usr/sbin/arpwatch -i $IFACE -f /var/lib/arpwatch/$IFACE.dat ${OPTIONS} - eend $? + start-stop-daemon --start --quiet --pidfile=/var/run/arpwatch.${IFACE}.pid --exec \ + /usr/sbin/arpwatch -- -i ${IFACE} -f ${DATAFILE} ${OPTIONS} else - setsid /usr/sbin/arpwatch -i $IFACE -u ${ARPUSER} -f /var/lib/arpwatch/$IFACE.dat ${OPTIONS} - eend $? + start-stop-daemon --start --quiet --pidfile=/var/run/arpwatch.${IFACE}.pid --exec \ + /usr/sbin/arpwatch -- -i $IFACE -u ${ARPUSER} -f ${DATAFILE} ${OPTIONS} fi + eend $? done } stop() { - ebegin "Stopping arpwatch" - killall arpwatch > /dev/null - eend $? + for IFACE in ${IFACES} + do + ebegin "Stopping arpwatch on ${IFACE}" + start-stop-daemon --stop --quiet --pidfile=/var/run/arpwatch.${IFACE}.pid --exec \ + /usr/sbin/arpwatch + eend $? + done } |