2000-03-10 14:53:23 +03:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
2006-10-08 22:08:39 +04:00
|
|
|
# $NetBSD: accounting,v 1.9 2006/10/08 18:08:39 elad Exp $
|
2000-03-10 14:53:23 +03:00
|
|
|
#
|
|
|
|
|
|
|
|
# PROVIDE: accounting
|
|
|
|
# REQUIRE: mountall
|
2002-03-22 07:33:57 +03:00
|
|
|
# BEFORE: DAEMON
|
2006-10-08 22:08:39 +04:00
|
|
|
# KEYWORD: shutdown
|
2000-03-10 14:53:23 +03:00
|
|
|
|
2004-08-13 22:08:03 +04:00
|
|
|
$_rc_subr_loaded . /etc/rc.subr
|
2000-03-10 14:53:23 +03:00
|
|
|
|
|
|
|
name="accounting"
|
2000-09-19 17:04:38 +04:00
|
|
|
rcvar=$name
|
2001-04-26 03:20:15 +04:00
|
|
|
accounting_command="/usr/sbin/accton"
|
|
|
|
accounting_file="/var/account/acct"
|
2000-03-10 14:53:23 +03:00
|
|
|
start_cmd="accounting_start"
|
|
|
|
stop_cmd="accounting_stop"
|
|
|
|
|
|
|
|
accounting_start()
|
|
|
|
{
|
2001-04-26 03:20:15 +04:00
|
|
|
if [ ! -f ${accounting_file} ]; then
|
|
|
|
echo "Creating accounting file ${accounting_file}"
|
2001-04-30 03:57:25 +04:00
|
|
|
( umask 022 ; > ${accounting_file} )
|
2000-03-10 14:53:23 +03:00
|
|
|
fi
|
2001-04-25 15:48:22 +04:00
|
|
|
echo "Turning on accounting."
|
2001-04-26 03:20:15 +04:00
|
|
|
${accounting_command} ${accounting_file}
|
2000-03-10 14:53:23 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
accounting_stop()
|
|
|
|
{
|
|
|
|
echo "Turning off accounting."
|
2001-04-26 03:20:15 +04:00
|
|
|
${accounting_command}
|
2000-03-10 14:53:23 +03:00
|
|
|
}
|
|
|
|
|
2000-05-13 12:45:06 +04:00
|
|
|
load_rc_config $name
|
2000-03-10 14:53:23 +03:00
|
|
|
run_rc_command "$1"
|