]>
Commit | Line | Data |
---|---|---|
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. | |
19 | [ -f /usr/bin/atsadc ] || exit 0 | |
20 | ||
21 | RETVAL=0 | |
22 | # See how we were called. | |
23 | case "$1" in | |
24 | start) | |
25 | # Check if the service is already running? | |
26 | if [ ! -f /var/lock/subsys/atsar ]; then | |
27 | # Run atsadc. | |
28 | msg_starting atsar | |
29 | daemon /usr/bin/atsadc /var/log/atsar/atsa`date +%d` | |
30 | RETVAL=$? | |
31 | rm -f /var/log/atsar/ftpstat 2> /dev/null | |
32 | rm -f /var/log/atsar/httpstat 2> /dev/null | |
33 | ||
34 | if [ -f /etc/atsar.conf ]; then | |
35 | /usr/bin/atsaftp | |
36 | /usr/bin/atsahttp | |
37 | fi | |
38 | echo | |
39 | [ $RETVAL -eq 0 ] && touch /var/lock/subsys/atsar | |
40 | else | |
41 | msg_already_running atsar | |
42 | fi | |
43 | ;; | |
44 | stop) | |
45 | if [ -f /var/lock/subsys/atsar ]; then | |
46 | msg_stopping atsar | |
47 | daemon rm -f /var/lock/subsys/atsar | |
48 | else | |
49 | msg_not_running atsar | |
50 | fi | |
51 | ;; | |
52 | status) | |
53 | ;; | |
54 | # reload) | |
55 | # # to be fixed | |
56 | # $0 stop | |
57 | # $0 start | |
58 | # exit $? | |
59 | # ;; | |
60 | restart|force-reload) | |
61 | $0 stop | |
62 | $0 start | |
63 | exit $? | |
64 | ;; | |
65 | *) | |
66 | msg_usage "$0 {start|stop|restart|force-reload|status}" | |
67 | exit 3 | |
68 | esac | |
69 | ||
70 | exit $RETVAL |