]> git.pld-linux.org Git - packages/atsar.git/blame - atsar.init
- added semicolons in for loops
[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#
8ef17270 6# chkconfig: 2345 85 15
00f4090c 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
00f4090c 22# See how we were called.
23case "$1" in
24 start)
da654e6e 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
00f4090c 33
da654e6e 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
00f4090c 42 fi
00f4090c 43 ;;
44 stop)
da654e6e 45 if [ -f /var/lock/subsys/atsar ]; then
8ef17270 46 msg_stopping atsar
9d68c9e1 47 daemon rm -f /var/lock/subsys/atsar
da654e6e 48 else
49 msg_not_running atsar
da654e6e 50 fi
00f4090c 51 ;;
52 status)
53 ;;
8ef17270 54# reload)
55# # to be fixed
56# $0 stop
57# $0 start
58# exit $?
59# ;;
9d68c9e1 60 restart|force-reload)
00f4090c 61 $0 stop
62 $0 start
9d68c9e1 63 exit $?
00f4090c 64 ;;
65 *)
8ef17270 66 msg_usage "$0 {start|stop|restart|force-reload|status}"
9d68c9e1 67 exit 3
00f4090c 68esac
69
70exit $RETVAL
This page took 0.072535 seconds and 4 git commands to generate.