Remove RC scripts for stuff we have don't have in our tree.
[dragonfly/netmp.git] / etc / rc.d / accounting
blob6f8413e77ac4dbf3c2aba661b4f4871726ae0099
1 #!/bin/sh
3 # $NetBSD: accounting,v 1.7 2002/03/22 04:33:57 thorpej Exp $
4 # $FreeBSD: src/etc/rc.d/accounting,v 1.4 2002/10/12 10:31:31 schweikh Exp $
5 # $DragonFly: src/etc/rc.d/accounting,v 1.4 2005/04/22 08:30:25 joerg Exp $
8 # PROVIDE: accounting
9 # REQUIRE: mountcritremote
10 # BEFORE: DAEMON
11 # KEYWORD: DragonFly
13 . /etc/rc.subr
15 name="accounting"
16 rcvar=`set_rcvar`
17 accounting_command="/usr/sbin/accton"
18 accounting_file="/var/account/acct"
19 start_cmd="accounting_start"
20 stop_cmd="accounting_stop"
22 accounting_start()
24 _dir=`dirname "$accounting_file"`
25 if [ ! -d `dirname "$_dir"` ]; then
26 if ! mkdir -p "$_dir"; then
27 warn "Could not create $_dir."
28 return 1
31 if [ ! -e "$accounting_file" ]; then
32 touch "$accounting_file"
34 echo "Turning on accounting."
35 ${accounting_command} ${accounting_file}
38 accounting_stop()
40 echo "Turning off accounting."
41 ${accounting_command}
44 load_rc_config $name
45 run_rc_command "$1"