You can set up system accounting to run while the system is in multiuser mode (Run Level 2). Generally, this task involves these steps:
Creating the /etc/rc0.d/K22acct and /etc/rc2.d/S22acct startup scripts
Modifying the /var/spool/cron/crontabs/adm and /var/spool/cron/crontabs/root crontab files
Table 9-1 Default Accounting Scripts
You can choose which accounting scripts run by default. After these entries have been added to the crontab files, system accounting should run automatically.
Roles contain authorizations and privileged commands. For more information about roles, see Configuring RBAC (Task Map) in System Administration Guide: Security Services.
# ln /etc/init.d/acct /etc/rc2.d/S22acct
# ln /etc/init.d/acct /etc/rc0.d/K22acct
# 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
# crontab -e 30 22 * * 4 /usr/lib/acct/dodisk
For more information, see the holidays(4) man page and the example that follows.
# /etc/init.d/acct start
Example 9-1 Setting Up Accounting (adm crontab)
#ident "@(#)adm 1.5 92/07/14 SMI" /* SVr4.0 1.2 */ # # The adm crontab file should contain startup of performance # collection if the profiling and performance feature has been # installed. 0 * * * * /usr/lib/acct/ckpacct 30 2 * * * /usr/lib/acct/runacct 2> /var/adm/acct/nite/fd2log 30 7 1 * * /usr/lib/acct/monacct
Example 9-2 Setting Up Accounting (root crontab)
#ident "@(#)root 1.19 98/07/06 SMI" /* SVr4.0 188.8.131.52 */ # # The root crontab should be used to perform accounting data collection. # # 10 3 * * * /usr/sbin/logadm 15 3 * * 0 /usr/lib/fs/nfs/nfsfind 30 3 * * * [ -x /usr/lib/gss/gsscred_clean ] && /usr/lib/gss/gsscred_clean 30 22 * * 4 /usr/lib/acct/dodisk
Example 9-3 Setting Up Accounting (/etc/acct/holidays)
* @(#)holidays January 1, 2004 * * Prime/Nonprime Table for UNIX Accounting System * * Curr Prime Non-Prime * Year Start Start * 2004 0800 1800 * * only the first column (month/day) is significant. * * month/day Company * Holiday * 1/1 New Years Day 7/4 Indep. Day 12/25 Christmas