import repository from arizona
[raven.git] / 2.0 / python / logging / tcpdumpd
1 #!/bin/sh
2 #
3 # tcpdumpd      Starts tcpdumpdaemon
4 #
5 # description: Starts the tcpdumpdaemon, which collects network packet 
6 #              information
7 #
8 ### BEGIN INIT INFO
9
10 # Source function library.
11 . /etc/init.d/functions
12
13 [ -f /usr/local/stork/bin/tcpdumpdaemon.py ] || exit 0
14
15 start() {
16         echo -n $"Starting tcpdump service: "
17         daemon /usr/local/stork/bin/tcpdumpdaemon.py
18         RETVAL=$?
19         echo
20         return $RETVAL
21 }
22
23 stop() {
24         echo -n $"Shutting down tcpdump service: "
25         killall -9 tcpdump &> /dev/null
26         kill -HUP `cat /tmp/tcpdump.pid 2> /dev/null` &> /dev/null
27         sleep 2
28         kill -9 `cat /tmp/tcpdump.pid 2> /dev/null` &> /dev/null
29         rm -f /tmp/tcpdump.pid &> /dev/null
30         RETVAL=0
31         RETVAL2=0
32         echo
33         return $RETVAL
34 }
35
36 restart() {
37         stop
38         start
39 }
40
41 rhstatus() {
42         echo "Sorry, not implemented..."
43 }       
44
45 case "$1" in
46   start)
47         start
48         ;;
49   stop)
50         stop
51         ;;
52   restart|reload|condrestart)
53         restart
54         ;;
55   status)
56         rhstatus
57         ;;
58   *)
59         echo $"Usage: $0 {start|stop|restart|reload|condrestart|status}"
60         exit 1
61 esac
62
63 exit $?