Revision 1, 1.8 kB
(checked in by ixs, 16 years ago)
|
initial checkin of RH revision
|
- Property svn:executable set to
*
|
Line | |
---|
1 |
#!/bin/sh |
---|
2 |
# |
---|
3 |
# flowmon Network Flow Export monitor |
---|
4 |
# |
---|
5 |
# chkconfig: - 98 02 |
---|
6 |
# description: FlowSpooler for NetFlow pkts |
---|
7 |
|
---|
8 |
### BEGIN INIT INFO |
---|
9 |
# Provides: flowmon-spooler |
---|
10 |
# Required-Start: $local_fs $network $named $time $mysqld $flowmon-collector |
---|
11 |
# Required-Stop: $local_fs $network $named $time $mysqld $flowmon-collector |
---|
12 |
# Should-Start: $syslog |
---|
13 |
# Should-Stop: $syslog |
---|
14 |
# Short-Description: FlowMon |
---|
15 |
# Description: # description: FlowSpooler |
---|
16 |
### END INIT INFO |
---|
17 |
|
---|
18 |
# Source function library. |
---|
19 |
. /etc/init.d/functions |
---|
20 |
|
---|
21 |
exec="/root/flowmon-0.9/flowmon-dbspooler.py" |
---|
22 |
prog="flowmon-dbspooler.py" |
---|
23 |
|
---|
24 |
[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog |
---|
25 |
|
---|
26 |
lockfile=/var/lock/subsys/$prog |
---|
27 |
|
---|
28 |
start() { |
---|
29 |
[ -x $exec ] || exit 5 |
---|
30 |
[ -f $config ] || exit 6 |
---|
31 |
echo -n $"Starting $prog: " |
---|
32 |
daemon --check $prog $exec -D $OPTIONS |
---|
33 |
retval=$? |
---|
34 |
echo |
---|
35 |
[ $retval -eq 0 ] && touch $lockfile |
---|
36 |
return $retval |
---|
37 |
} |
---|
38 |
|
---|
39 |
stop() { |
---|
40 |
echo -n $"Stopping $prog: " |
---|
41 |
killproc -p $PIDFILE -d 5 $prog |
---|
42 |
retval=$? |
---|
43 |
echo |
---|
44 |
[ $retval -eq 0 ] && rm -f $lockfile |
---|
45 |
return $retval |
---|
46 |
} |
---|
47 |
|
---|
48 |
restart() { |
---|
49 |
stop |
---|
50 |
start |
---|
51 |
} |
---|
52 |
|
---|
53 |
reload() { |
---|
54 |
restart |
---|
55 |
} |
---|
56 |
|
---|
57 |
force_reload() { |
---|
58 |
restart |
---|
59 |
} |
---|
60 |
|
---|
61 |
rh_status() { |
---|
62 |
# run checks to determine if the service is running or use generic status |
---|
63 |
status $prog |
---|
64 |
} |
---|
65 |
|
---|
66 |
rh_status_q() { |
---|
67 |
rh_status >/dev/null 2>&1 |
---|
68 |
} |
---|
69 |
|
---|
70 |
case "$1" in |
---|
71 |
start) |
---|
72 |
rh_status_q && exit 0 |
---|
73 |
$1 |
---|
74 |
;; |
---|
75 |
stop) |
---|
76 |
rh_status_q || exit 0 |
---|
77 |
$1 |
---|
78 |
;; |
---|
79 |
restart) |
---|
80 |
$1 |
---|
81 |
;; |
---|
82 |
reload) |
---|
83 |
rh_status_q || exit 7 |
---|
84 |
$1 |
---|
85 |
;; |
---|
86 |
force-reload) |
---|
87 |
force_reload |
---|
88 |
;; |
---|
89 |
status) |
---|
90 |
rh_status |
---|
91 |
;; |
---|
92 |
condrestart|try-restart) |
---|
93 |
rh_status_q || exit 0 |
---|
94 |
restart |
---|
95 |
;; |
---|
96 |
*) |
---|
97 |
echo $"Usage: $0 {start|stop|status|restart|try-restart|reload|force-reload}" |
---|
98 |
exit 2 |
---|
99 |
esac |
---|
100 |
exit $? |
---|