summaryrefslogtreecommitdiff
blob: 444729d9fb60f1f267a6d90ad3e3e821f5310776 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/sbin/runscript
# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/sys-process/acct/files/acct.rc6,v 1.3 2006/01/10 00:20:00 vapier Exp $

opts="report"

depend() {
    need localmount
}

checkconfig() {
	export ACCT_LOG=${ACCT_LOG:-/var/account/pacct}
	if [[ ! -e ${ACCT_LOG} ]] ; then
		touch "${ACCT_LOG}"
		chmod 600 "${ACCT_LOG}"
	fi
	return 0
}

start() {
	checkconfig || return 1

	ebegin "Starting accounting"
	/usr/sbin/accton "${ACCT_LOG}"
	eend $?
}

stop() {
	ebegin "Stopping accounting"
	/usr/sbin/accton
	eend $?
}

report() {
	sa ${REPORT_OPTS} "${ACCT_LOG}"
}

# vim:ts=4 sw=4: