- updated
[packages/atsar.git] / atsar.init
CommitLineData
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.
11if [ -f /etc/rc.d/init.d/functions ]
12then
13 . /etc/rc.d/init.d/functions
14else
15 alias daemon=nice
16fi
17
18# Check binaries and configuration files.
57ec76dc 19[ -f /usr/bin/atsadc ] || exit 0
00f4090c 20
21RETVAL=0
22
23# See how we were called.
24case "$1" in
25 start)
da654e6e 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
00f4090c 34
da654e6e 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
00f4090c 44 fi
00f4090c 45 ;;
46 stop)
da654e6e 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
00f4090c 55 ;;
56 status)
57 ;;
58 reload)
59 $0 stop
60 $0 start
61 ;;
62 restart)
63 $0 stop
64 $0 start
65 ;;
66 *)
da654e6e 67 msg_usage "$0 {start|stoprestart|reload|status}"
00f4090c 68 exit 1
69esac
70
71exit $RETVAL
This page took 0.042505 seconds and 4 git commands to generate.