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