]>
Commit | Line | Data |
---|---|---|
00f4090c | 1 | #!/bin/sh |
2 | # | |
3 | # atsar This shell script takes care of initializing | |
4 | # the atsar system activity report subsystem. | |
5 | # | |
6 | # chkconfig: 2345 85 15 | |
7 | # description: Atsar is a system activity report logging system. | |
8 | # | |
9 | ||
10 | # Source function library. | |
11 | if [ -f /etc/rc.d/init.d/functions ] | |
12 | then | |
13 | . /etc/rc.d/init.d/functions | |
14 | else | |
15 | alias daemon=nice | |
16 | fi | |
17 | ||
18 | # Check binaries and configuration files. | |
57ec76dc | 19 | [ -f /usr/bin/atsadc ] || exit 0 |
00f4090c | 20 | |
21 | RETVAL=0 | |
22 | ||
23 | # See how we were called. | |
24 | case "$1" in | |
25 | start) | |
26 | # Run atsadc. | |
27 | msg_starting "atsar" | |
57ec76dc | 28 | daemon /usr/bin/atsadc /var/log/atsar/atsa`date +%d` |
00f4090c | 29 | RETVAL=$? |
30 | rm -f /var/log/atsar/ftpstat 2> /dev/null | |
31 | rm -f /var/log/atsar/httpstat 2> /dev/null | |
32 | ||
33 | if [ -f /etc/atsar.conf ] | |
34 | then | |
57ec76dc AM |
35 | /usr/bin/atsaftp |
36 | /usr/bin/atsahttp | |
00f4090c | 37 | fi |
38 | echo | |
39 | [ $RETVAL -eq 0 ] && touch /var/lock/subsys/atsar | |
40 | ;; | |
41 | stop) | |
57ec76dc AM |
42 | msg_stopping "atsar" |
43 | daemon rm -f /var/lock/subsys/atsar | |
44 | RETVAL=$? | |
00f4090c | 45 | ;; |
46 | status) | |
47 | ;; | |
48 | reload) | |
49 | $0 stop | |
50 | $0 start | |
51 | ;; | |
52 | restart) | |
53 | $0 stop | |
54 | $0 start | |
55 | ;; | |
56 | *) | |
57 | echo "Usage: $0 {start|stop|status|reload|restart}" | |
58 | exit 1 | |
59 | esac | |
60 | ||
61 | exit $RETVAL |