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