#!/bin/sh
#
# sysstat	Reset the system activity logs
#
# chkconfig: 12345 01 99
# description: Write a marker into sysstat logs
#
### BEGIN INIT INFO
# Provides: sysstat
# Required-Start: $local_fs $remote_fs $syslog
# Required-Stop:
# Default-Start: 1 2 3 4 5
# Default-Stop:  0 6
# Short-Description: Write a marker into sysstat logs
# Description: Sysstat contains system performance tools for Linux
# The init file runs the sadc command in order to write
# the "LINUX RESTART" mark to the daily data file
### END INIT INFO

WITHOUT_RC_COMPAT=1

# Source function library.
. /etc/init.d/functions

LOCKFILE=/var/lock/subsys/sysstat
RETVAL=0

# See how we were called.
case "$1" in
	start)
		action "Resetting the system activity logs:" /usr/lib64/sa/sa1 --boot
		RETVAL=$?
		# Mark as started regardless of exit status.
		touch "$LOCKFILE"
		;;
	stop|condstop)
		rm -f "$LOCKFILE"
		;;
	restart|reload|force-reload|condrestart|try-restart|status)
		;;
	*)
		msg_usage "${0##*/} {start|stop}"
		RETVAL=1
esac

exit $RETVAL
