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