accounting revision 1.5
1#!/bin/sh
2#
3# $NetBSD: accounting,v 1.5 2001/04/25 23:20:15 lukem Exp $
4#
5
6# PROVIDE: accounting
7# REQUIRE: mountall
8
9. /etc/rc.subr
10
11name="accounting"
12rcvar=$name
13accounting_command="/usr/sbin/accton"
14accounting_file="/var/account/acct"
15start_cmd="accounting_start"
16stop_cmd="accounting_stop"
17
18accounting_start()
19{
20	if [ ! -f ${accounting_file} ]; then
21		echo "Creating accounting file ${accounting_file}"
22		( umask 022 ; echo -n > ${accounting_file} )
23	fi
24	echo "Turning on accounting."
25	${accounting_command} ${accounting_file}
26}
27
28accounting_stop()
29{
30	echo "Turning off accounting."
31	${accounting_command}
32}
33
34load_rc_config $name
35run_rc_command "$1"
36