0
|
1 #!@BASH@
|
|
2 #
|
|
3 # wflogs-daemon This script controls the wflogs-daemon daemon.
|
|
4 #
|
|
5 #
|
|
6 # chkconfig: 2345 60 40
|
|
7 # description: wflogs-daemon monitors syslog files, feeds pieces to wflogs
|
|
8 # processname: wflogs-daemon
|
|
9 # pidfile: /var/run/wflogs-daemon.pid
|
|
10 # Source function library.
|
|
11 #
|
|
12 . /etc/rc.d/init.d/functions
|
|
13
|
|
14 # Source networking configuration.
|
|
15 . /etc/sysconfig/network
|
|
16
|
|
17 RETVAL=0
|
|
18 # See how we were called.
|
|
19 case "$1" in
|
|
20 start)
|
|
21 # Start daemons.
|
|
22 echo -n "Starting wflogs-daemon: "
|
|
23 if [ ! -f /var/lock/subsys/wflogs-daemon ]; then
|
|
24 cd SYSCONFDIR # conf file is here
|
|
25 SBINDIR/wflogs-daemon -d 3
|
|
26 RETVAL=$?
|
|
27 pid=`pidof -s SBINDIR/wflogs-daemon`
|
|
28 if [ $pid ]
|
|
29 then
|
|
30 success "Starting wflogs-daemon :"
|
|
31 touch /var/lock/subsys/wflogs-daemon
|
|
32 echo
|
|
33 else
|
|
34 failure "Starting wflogs-daemon:"
|
|
35 echo
|
|
36 fi
|
|
37 else
|
|
38 echo -n "already running! "
|
|
39 failure "wflogs-daemon already running!"
|
|
40 echo
|
|
41 fi
|
|
42
|
|
43 ;;
|
|
44 stop)
|
|
45 # Stop daemons.
|
|
46 echo -n "Shutting down wflogs-daemon: "
|
|
47 killproc wflogs-daemon
|
|
48 RETVAL=$?
|
|
49 echo
|
|
50 [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/wflogs-daemon
|
|
51 ;;
|
|
52 restart|reload)
|
|
53 $0 stop
|
|
54 $0 start
|
|
55 RETVAL=$?
|
|
56 ;;
|
|
57 status)
|
|
58 status wflogs-daemon
|
|
59 RETVAL=$?
|
|
60 ;;
|
|
61 *)
|
|
62 echo "Usage: wflogs-daemon {start|stop|restart|reload|status}"
|
|
63 exit 1
|
|
64 esac
|
|
65 exit $RETVAL
|