summaryrefslogtreecommitdiff
blob: b895f2257aa79c5cb8c73a53f3e4d4fdda5ccb33 (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
#!/sbin/openrc-run
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$

extra_started_commands="report"

depend() {
	need localmount
}

checkconfig() {
	export ACCT_LOG=${ACCT_LOG:-/var/account/pacct}
	checkpath -f -m 600 "${ACCT_LOG}"
	return 0
}

start() {
	checkconfig || return 1

	ebegin "Starting accounting"
	accton "${ACCT_LOG}" >/dev/null
	eend $?
}

stop() {
	ebegin "Stopping accounting"
	accton off >/dev/null
	eend $?
}

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