1、安装包SUNWaccr和SUNWaccu
2、# ln /etc/init.d/acct /etc/rc2.d/S22acct
# ln /etc/init.d/acct /etc/rc0.d/K22acct
或
# ln -s /etc/init.d/acct /etc/rc2.d/S22acct
# ln -s /etc/init.d/acct /etc/rc0.d/K22acct
3、把以下内容加入到adm的crontab中
# EDITOR=vi; export EDITOR
# crontab -e adm
0 * * * * /usr/lib/acct/ckpacct
30 2 * * * /usr/lib/acct/runacct 2> /var/adm/acct/nite/fd2log
30 7 1 * * /usr/lib/acct/monacct
4、把dodisk加入到root的crontab中
# crontab -e
30 22 * * 4 /usr/lib/acct/dodisk
5、修改/etc/acct/holidays加入holiday信息
6、reboot系统或手工启动acct
# /etc/init.d/acct start
附:/etc/init.d/acct脚本内容
root@com00mlcprc10:/usr/lib/acct #> more /etc/init.d/acct
#!/sbin/sh
#
# Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T.
# All rights reserved.
#
# THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T
# The copyright notice above does not evidence any
# actual or intended publication of such source code.
#
# Copyright 2004 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
#ident "@(#)acct.sh 1.4 04/07/15 SMI"
state="$1"
case "$state" in
'start')
echo 'Starting process accounting'
/usr/lib/acct/startup
;;
'stop')
echo 'Stopping process accounting'
/usr/lib/acct/shutacct
;;
*)
echo "Usage: $0 { start | stop }"
exit 1
;;
esac
exit 0
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/228190/viewspace-681680/
,如需转载,请注明出处,否则将追究法律责任。