diff options
-rw-r--r-- | sys-process/acct/ChangeLog | 10 | ||||
-rw-r--r-- | sys-process/acct/acct-6.5.5-r1.ebuild | 37 | ||||
-rw-r--r-- | sys-process/acct/files/acct.initd | 12 | ||||
-rw-r--r-- | sys-process/acct/files/acct.initd-r1 | 45 | ||||
-rw-r--r-- | sys-process/acct/files/acct.logrotate | 9 | ||||
-rw-r--r-- | sys-process/acct/files/acct.logrotate-r1 | 14 |
6 files changed, 115 insertions, 12 deletions
diff --git a/sys-process/acct/ChangeLog b/sys-process/acct/ChangeLog index 8c93a3d2ab9c..ff4bc810a395 100644 --- a/sys-process/acct/ChangeLog +++ b/sys-process/acct/ChangeLog @@ -1,6 +1,14 @@ # ChangeLog for sys-process/acct # Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sys-process/acct/ChangeLog,v 1.46 2011/01/23 14:52:48 armin76 Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-process/acct/ChangeLog,v 1.47 2011/01/26 05:36:22 jer Exp $ + +*acct-6.5.5-r1 (26 Jan 2011) + + 26 Jan 2011; Jeroen Roovers <jer@gentoo.org> +acct-6.5.5-r1.ebuild, + +files/acct.initd-r1, +files/acct.logrotate-r1, files/acct.initd, + files/acct.logrotate: + Make logrotate script compatible with both baselayout 1 and 2, by Eugeny + Shkrigunov (bug #351428), patches by Robert Trace. 23 Jan 2011; Raúl Porcel <armin76@gentoo.org> acct-6.5.5.ebuild: alpha stable wrt #350050 diff --git a/sys-process/acct/acct-6.5.5-r1.ebuild b/sys-process/acct/acct-6.5.5-r1.ebuild new file mode 100644 index 000000000000..6ff9e8157d74 --- /dev/null +++ b/sys-process/acct/acct-6.5.5-r1.ebuild @@ -0,0 +1,37 @@ +# Copyright 1999-2011 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-process/acct/acct-6.5.5-r1.ebuild,v 1.1 2011/01/26 05:36:22 jer Exp $ + +EAPI="2" + +inherit eutils + +DESCRIPTION="GNU system accounting utilities" +HOMEPAGE="https://savannah.gnu.org/projects/acct/" +SRC_URI="mirror://gnu/${PN}/${P}.tar.gz" + +LICENSE="GPL-3" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~hppa ~ppc ~x86" +IUSE="" + +src_configure() { + econf --enable-linux-multiformat +} + +src_install() { + emake install DESTDIR="${D}" || die + dodoc AUTHORS ChangeLog INSTALL NEWS README TODO + keepdir /var/account + newinitd "${FILESDIR}"/acct.initd-r1 acct || die + newconfd "${FILESDIR}"/acct.confd acct || die + insinto /etc/logrotate.d + newins "${FILESDIR}"/acct.logrotate-r1 acct || die + + # sys-apps/sysvinit already provides this + rm "${D}"/usr/bin/last "${D}"/usr/share/man/man1/last.1 || die + + # accton in / is only a temp workaround for #239748 + dodir /sbin + mv "${D}"/usr/sbin/accton "${D}"/sbin/ || die +} diff --git a/sys-process/acct/files/acct.initd b/sys-process/acct/files/acct.initd index 29fb28ab65fc..2f66068625c0 100644 --- a/sys-process/acct/files/acct.initd +++ b/sys-process/acct/files/acct.initd @@ -1,9 +1,9 @@ #!/sbin/runscript -# Copyright 1999-2009 Gentoo Foundation +# Copyright 1999-2011 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-process/acct/files/acct.initd,v 1.1 2010/04/28 19:32:40 jer Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-process/acct/files/acct.initd,v 1.2 2011/01/26 05:36:22 jer Exp $ -opts="report" +opts="report reload" depend() { need localmount @@ -36,4 +36,10 @@ report() { sa ${REPORT_OPTS} "${ACCT_LOG}" } +reload() { + service_started "${SVCNAME}" || return + svc_stop + svc_start +} + # vim:ts=4 sw=4: diff --git a/sys-process/acct/files/acct.initd-r1 b/sys-process/acct/files/acct.initd-r1 new file mode 100644 index 000000000000..6edc548ad2fd --- /dev/null +++ b/sys-process/acct/files/acct.initd-r1 @@ -0,0 +1,45 @@ +#!/sbin/runscript +# Copyright 1999-2011 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-process/acct/files/acct.initd-r1,v 1.1 2011/01/26 05:36:22 jer Exp $ + +opts="report reload" + +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" + accton "${ACCT_LOG}" + eend $? +} + +stop() { + ebegin "Stopping accounting" + accton off + eend $? +} + +report() { + sa ${REPORT_OPTS} "${ACCT_LOG}" +} + +reload() { + service_started "${SVCNAME}" || return + svc_stop + svc_start +} + +# vim:ts=4 sw=4: diff --git a/sys-process/acct/files/acct.logrotate b/sys-process/acct/files/acct.logrotate index 766d4c05bef2..26f98115e2a0 100644 --- a/sys-process/acct/files/acct.logrotate +++ b/sys-process/acct/files/acct.logrotate @@ -1,11 +1,6 @@ # Logrotate file for acct /var/account/pacct { - prerotate - if [ -h /lib/rc/init.d/started/acct ]; then - /etc/init.d/acct stop > /dev/null 2>&1 || true - fi - endscript compress delaycompress notifempty @@ -14,8 +9,6 @@ create 0600 root root missingok postrotate - if [ -h /lib/rc/init.d/started/acct ]; then - /etc/init.d/acct start > /dev/null 2>&1 || true - fi + /etc/init.d/acct reload > /dev/null 2>&1 endscript } diff --git a/sys-process/acct/files/acct.logrotate-r1 b/sys-process/acct/files/acct.logrotate-r1 new file mode 100644 index 000000000000..26f98115e2a0 --- /dev/null +++ b/sys-process/acct/files/acct.logrotate-r1 @@ -0,0 +1,14 @@ +# Logrotate file for acct + +/var/account/pacct { + compress + delaycompress + notifempty + daily + rotate 31 + create 0600 root root + missingok + postrotate + /etc/init.d/acct reload > /dev/null 2>&1 + endscript +} |