]> git.pld-linux.org Git - packages/sysstat.git/blob - sysstat.init
- rel. 3 for Ac
[packages/sysstat.git] / sysstat.init
1 #!/bin/sh
2 #
3 # sysstat       Sysstat system monitoring utility
4 #
5 # chkconfig:    2345 35 55
6 #
7 # description:  Sysstat system monitoring tools (sar,iostat,mpstat)
8 #
9
10 # Source function library
11 . /etc/rc.d/init.d/functions
12
13 RETVAL=0
14 # See how we were called.
15 case "$1" in
16   start)
17         # Check if the service is already running?
18         if [ ! -f /var/lock/subsys/sysstat ]; then
19                 msg_starting "system activity data collector"
20                 daemon /usr/lib/sa/sadc
21                 RETVAL=$?
22                 [ "$RETVAL" -eq 0 ] && touch /var/lock/subsys/sysstat
23         else
24                 msg_already_running "system activity data collector"
25         fi
26         ;;
27   stop)
28         if [ -f /var/lock/subsys/sysstat ]; then
29                 # Stop daemons.
30                 msg_stopping "system activity data collector"
31                 ok
32                 rm -f /var/lock/subsys/sysstat >/dev/null 2>&1
33         else
34                 msg_not_running "system activity data collector"
35         fi
36         ;;
37   status)
38         status sysstat
39         exit $?
40         ;;
41   restart|force-reload)
42         $0 stop
43         $0 start
44         exit $?
45         ;;
46   *)
47         msg_usage "$0 {start|stop|restart|force-reload|status}"
48         exit 3
49         ;;
50 esac
51
52 exit $RETVAL
This page took 0.026059 seconds and 3 git commands to generate.