#!/bin/sh
#
#@(#)$Id: facct,v 1.1 2000/10/17 19:58:06 jonest Exp $ 
#@(#)$Author: jonest $
#@(#)$Log: facct,v $
#@(#)Revision 1.1  2000/10/17 19:58:06  jonest
#@(#)Initial commit of the Fermi Linux Process Accounting.
#@(#)
#
# acct        Starts /usr/sbin/accton.
#
# chkconfig: 35 45 45
#
# description: Start, Stop and Reset Process Accounting \
#              Process data is written to the /var/log/pacct file. \

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

[ -f /usr/sbin/accton ] || exit 0
# See how we were called.
case "$1" in
  start)
        # Start daemons.
        /usr/sbin/accton /var/log/pacct
        echo "  Process Accounting turned on"
        ;;
  stop)
        # Stop daemons.
        /usr/sbin/accton
        echo "  Process Accounting turned off"
        ;;
  restart)
        # stop, move pacct file, restart.
        /usr/sbin/accton
        mv /var/log/pacct /var/log/Opacct
        touch /var/log/pacct
        /usr/sbin/accton /var/log/pacct
        echo "  Recycled the /var/log/pacct file"
        ;;
  *)
        echo "Usage: accton {start|stop|restart}"
        exit 1
esac
exit 0

