summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2006-01-10 00:20:00 +0000
committerMike Frysinger <vapier@gentoo.org>2006-01-10 00:20:00 +0000
commit4c1275a5058146d9f818f4f244a9753b5038355e (patch)
treef669025395d6443421cd532cfaa03b0963f030c2 /sys-process/acct
parent2.2 version bump. Hopefully fixes bugs 68175 and 63013. (diff)
downloadgentoo-2-4c1275a5058146d9f818f4f244a9753b5038355e.tar.gz
gentoo-2-4c1275a5058146d9f818f4f244a9753b5038355e.tar.bz2
gentoo-2-4c1275a5058146d9f818f4f244a9753b5038355e.zip
Add some custom init.d options by Hubert MERCIER #118399.
(Portage version: 2.1_pre3-r1)
Diffstat (limited to 'sys-process/acct')
-rw-r--r--sys-process/acct/ChangeLog8
-rw-r--r--sys-process/acct/acct-6.3.5-r2.ebuild5
-rw-r--r--sys-process/acct/files/acct.confd13
-rw-r--r--sys-process/acct/files/acct.rc625
4 files changed, 42 insertions, 9 deletions
diff --git a/sys-process/acct/ChangeLog b/sys-process/acct/ChangeLog
index c50fb74e1653..441ed5c251ac 100644
--- a/sys-process/acct/ChangeLog
+++ b/sys-process/acct/ChangeLog
@@ -1,6 +1,10 @@
# ChangeLog for sys-process/acct
-# Copyright 1999-2005 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-process/acct/ChangeLog,v 1.7 2005/10/04 23:48:37 vapier Exp $
+# Copyright 1999-2006 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/sys-process/acct/ChangeLog,v 1.8 2006/01/10 00:20:00 vapier Exp $
+
+ 10 Jan 2006; Mike Frysinger <vapier@gentoo.org> +files/acct.confd,
+ files/acct.rc6, acct-6.3.5-r2.ebuild:
+ Add some custom init.d options by Hubert MERCIER #118399.
*acct-6.3.5-r2 (04 Oct 2005)
diff --git a/sys-process/acct/acct-6.3.5-r2.ebuild b/sys-process/acct/acct-6.3.5-r2.ebuild
index 0b48489ce22e..43c52804684e 100644
--- a/sys-process/acct/acct-6.3.5-r2.ebuild
+++ b/sys-process/acct/acct-6.3.5-r2.ebuild
@@ -1,6 +1,6 @@
-# Copyright 1999-2005 Gentoo Foundation
+# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-process/acct/acct-6.3.5-r2.ebuild,v 1.1 2005/10/04 23:48:37 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-process/acct/acct-6.3.5-r2.ebuild,v 1.2 2006/01/10 00:20:00 vapier Exp $
inherit eutils
@@ -33,4 +33,5 @@ src_install() {
dodoc AUTHORS ChangeLog INSTALL NEWS README ToDo
keepdir /var/account
newinitd "${FILESDIR}"/acct.rc6 acct
+ newconfd "${FILESDIR}"/acct.confd acct
}
diff --git a/sys-process/acct/files/acct.confd b/sys-process/acct/files/acct.confd
new file mode 100644
index 000000000000..133efabcf62d
--- /dev/null
+++ b/sys-process/acct/files/acct.confd
@@ -0,0 +1,13 @@
+# /etc/conf.d/acct
+
+# ACCT_LOG specifies the accounting logging file.
+# Remember to create it manually if it doesn't yet exist.
+
+ACCT_LOG="/var/account/pacct"
+
+# REPORT_OPTS contains arguments for the "sa" command,
+# used for console-reporting.
+# Please run "sa --help" or "man sa" to get a description
+# of available options.
+
+REPORT_OPTS="--sort-real-time --list-all-names --percentage"
diff --git a/sys-process/acct/files/acct.rc6 b/sys-process/acct/files/acct.rc6
index 0c81485ab50d..444729d9fb60 100644
--- a/sys-process/acct/files/acct.rc6
+++ b/sys-process/acct/files/acct.rc6
@@ -1,17 +1,28 @@
#!/sbin/runscript
-# Copyright 1999-2005 Gentoo Foundation
+# 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.2 2005/03/21 03:47:19 robbat2 Exp $
+# $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"
- touch /var/account/pacct
- chmod 600 /var/account/pacct
- /usr/sbin/accton /var/account/pacct
+ /usr/sbin/accton "${ACCT_LOG}"
eend $?
}
@@ -21,4 +32,8 @@ stop() {
eend $?
}
+report() {
+ sa ${REPORT_OPTS} "${ACCT_LOG}"
+}
+
# vim:ts=4 sw=4: