First Last Prev Next    No search results available      Search page      Enter new bug
Bug#: 118399
Alias:
Product:
Component:
Status: RESOLVED
Resolution: FIXED
Assigned To: Gentoo's Team for Core System packages <base-system@gentoo.org>
Hardware:
OS:
Version:
Priority:
Severity:
Reporter: Hubert Mercier (RETIRED) <anigel@gentoo.org>
Add CC:
CC:
URL:
Summary:
Status Whiteboard:
Keywords:

Filename Description Type Creator Created Size Actions
conf.d.acct acct config defaults (/etc/conf.d/acct) text/plain Hubert Mercier (RETIRED) 2006-01-09 05:42 0000 405 bytes Details
init.d.acct /etc/init.d/acct text/plain Hubert Mercier (RETIRED) 2006-01-09 05:43 0000 959 bytes Details
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 118399 depends on: Show dependency tree
Bug 118399 blocks:
Votes: 0    Show votes for this bug    Vote for this bug

Additional Comments: (this is where you put emerge --info)


Not eligible to see or edit group visibility for this bug.






View Bug Activity   |   Format For Printing   |   XML   |   Clone This Bug


Description:   Opened: 2006-01-09 05:40 0000
Hello :)

I recently had to deal with acct, and its configuration. In order to meet my
needs, I made a few modifications to its init scripts and environment, and
added some configuration items to it. I'd like to share these with the
community, if you find them useable ?

First, I've added a configuration file to the package : /etc/conf.d/acct.

# ACCT_LOG specifies the accounting logging file.
# Remember to create it manually if it doesn't yet exist.
# Default : ACCT_LOG="/var/account/pacct"
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"



Then, I had to modify the /etc/init.d/acct script to deal with these new
configuration items :

#!/sbin/runscript
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

opts="${opts} report"


depend() {
        need localmount
}


start() {
        if [ -z ${ACCT_LOG} ] ; then
                ewarn "Unable to load configuration. Please check
/etc/conf.d/acct."
                return 1
        fi

        if ! [ -f ${ACCT_LOG} ] ; then
                ewarn "${ACCT_LOG} does not exists. Trying to create it
automatically..."
                touch ${ACCT_LOG}
                chmod 600 ${ACCT_LOG}
        fi
        ebegin "Starting accounting"
        /usr/sbin/accton ${ACCT_LOG}
        eend ${ret}
}


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


report() {
        if ! service_started "${myservice}" ; then
                ewarn ""
                ewarn "Service is not started. Statistics may be obsolete !"
                ewarn "If you really wish to get this information, please run
:"
                ewarn ""
                ewarn "   sa ${REPORT_OPTS} ${ACCT_LOG}"
                ewarn ""
        else    sa ${REPORT_OPTS} ${ACCT_LOG}
        fi
        return $?
}


restart() {
        svc_stop
        svc_start
}


And that's all. Just a little enhancement, as you see ;-). But it allows to
successfully run this tool without any further configuration, which may gain
time to other users ?

------- Comment #1 From Hubert Mercier (RETIRED) 2006-01-09 05:42:35 0000 -------
Created an attachment (id=76613) [edit]
acct config defaults (/etc/conf.d/acct)

------- Comment #2 From Hubert Mercier (RETIRED) 2006-01-09 05:43:09 0000 -------
Created an attachment (id=76614) [edit]
/etc/init.d/acct

------- Comment #3 From SpanKY 2006-01-09 16:19:56 0000 -------
cleaned up and added to cvs, thanks

First Last Prev Next    No search results available      Search page      Enter new bug