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