#!/usr/sbin/sh # # Copyright (c) 1988, 2011, Oracle and/or its affiliates. All rights reserved. # # Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T # All Rights Reserved # "control process accounting (must be root)" # "turnacct on makes sure it's on" # "turnacct off turns it off" # "turnacct switch switches pacct to pacct?, starts fresh one" # "/var/adm/pacct is always the current pacct file" PATH=/usr/lib/acct:/usr/bin:/usr/sbin cd /var/adm case "$1" in on) if test ! -r pacct then nulladm pacct fi accton pacct _rc=$? ;; off) accton _rc=$? ;; switch) pfexec /usr/sbin/logadm -p now /var/adm/pacct if test ! -r pacct then nulladm pacct accton pacct fi _rc=$? ;; *) echo "Usage: turnacct on|off|switch" >&2 _rc=1 ;; esac exit ${_rc}