[BACK]Return to accounting CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / etc / rc.d

Annotation of src/etc/rc.d/accounting, Revision 1.9

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

CVSweb <webmaster@jp.NetBSD.org>