#!/bin/sh # psaccts This shell script takes care of starting and stopping process accounting. # # chkconfig: 2345 05 92 # description: process accounting. # Source function library. . /etc/rc.d/init.d/functions [ -x /usr/sbin/accton ] || exit 0 case "$1" in start) action "Starting process accounting: " /usr/sbin/accton /var/log/pacct RETVAL=$? [ $RETVAL -eq 0 ] && touch /var/lock/subsys/psacct ;; stop) action "Stopping process accounting: " /usr/sbin/accton RETVAL=$? [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/psacct ;; restart) $0 stop $0 start ;; *) echo "Usage: $0 {start|stop|restart}" exit 1 esac exit 0