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