#
# sysstat Sysstat system monitoring utility
#
-# chkconfig: 2345 35 55
+# chkconfig: 2345 35 65
#
# description: Sysstat system monitoring tools (sar,iostat,mpstat)
#
+# $Id$
# Source function library
. /etc/rc.d/init.d/functions
-RETVAL=0
-# See how we were called.
-case "$1" in
- start)
+[ -f /etc/sysconfig/sysstat ] && . /etc/sysconfig/sysstat
+
+start() {
# Check if the service is already running?
if [ ! -f /var/lock/subsys/sysstat ]; then
msg_starting "system activity data collector"
- daemon /usr/lib/sa/sadc
+ daemon /usr/lib/sa/sadc $SADC_OPTIONS -
RETVAL=$?
[ "$RETVAL" -eq 0 ] && touch /var/lock/subsys/sysstat
else
msg_already_running "system activity data collector"
fi
- ;;
- stop)
+}
+
+stop() {
if [ -f /var/lock/subsys/sysstat ]; then
# Stop daemons.
msg_stopping "system activity data collector"
else
msg_not_running "system activity data collector"
fi
+}
+
+condrestart() {
+ if [ -f /var/lock/subsys/sysstat ]; then
+ stop
+ start
+ else
+ msg_not_running "system activity data collector"
+ RETVAL=$1
+ fi
+}
+
+RETVAL=0
+# See how we were called.
+case "$1" in
+ start)
+ start
+ ;;
+ stop)
+ stop
+ ;;
+ restart)
+ stop
+ start
+ ;;
+ try-restart)
+ condrestart 0
+ ;;
+ force-reload)
+ condrestart 7
;;
status)
status sysstat
exit $?
;;
- restart|force-reload)
- $0 stop
- $0 start
- exit $?
- ;;
*)
- msg_usage "$0 {start|stop|restart|force-reload|status}"
+ msg_usage "$0 {start|stop|restart|try-restart|force-reload|status}"
exit 3
;;
esac