Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 191084 - sys-power/acpid -adding a quiet logging mode
Summary: sys-power/acpid -adding a quiet logging mode
Status: RESOLVED UPSTREAM
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: Gentoo Linux bug wranglers
URL: https://sourceforge.net/tracker/index...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-09-02 18:48 UTC by Bill "vaxbrat" Sharer
Modified: 2007-09-02 18:54 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Bill "vaxbrat" Sharer 2007-09-02 18:48:07 UTC
I've submitted this to acpid.sourceforge.net as feature request 1786726.  Here's a paste of the description:

I'm currently using acpid on an HP Turion ML40 based laptop under gentoo as the acpid-1.0.6 ebuild.  This uses the apcid-1.0.6.tar.gz tarball as is without any patches.

I'm not sure if this is a quirk of the ML40, but acpid handles a CPU0 processor event on the order of one every second or more.  This results in about 3 LOG_INFO level messages going to the syslog, and the current software doesn't allow the logging level to be turned off or tuned.

The resulting datastorm rapidly fills both /var/log/syslog and /var/log/messages and prevents any sort of battery mode conservation by spinning down the hard drive.

I've hacked my config as follows in order to provide a new q switch for quiet mode that only logs LOG_NOTICE or lower when enabled.  I've also changed a couple of logging calls from LOG_INFO to LOG_NOTICE so that they would still appear.  Logging runs as before if the switch is not supplied on startup.

I actually think that LOG_INFO level reports from events should be removed in favor of having the user do something with the triggers and scripts in /etc/acpid instead, but I guess you wouldn't see what a CLIENT may be up to.


Reproducible: Always

Steps to Reproduce:
1.Start acpid on a laptop that generates a lot of processor events
2.
3.

Actual Results:  
As I mentioned, I don't know if this is a quirk of my laptop's processor or is a fairly common thing.  However your syslog and messages will grow rapidly

Expected Results:  
Being able to use the syslog and messages files as useful logs.

Here's the diffs I posted of the two files acpid.c and event.c

----------------------


diffs to acpid.c

58a59
> static int quiet = 0;
161c162,163
<       acpid_log(LOG_INFO, "starting up\n");
---
>       acpid_log(LOG_NOTICE, "starting up\n");
>       if (quiet) acpid_log(LOG_NOTICE, "starting in quiet mode\n");
272a275
>               {"quiet", 0, 0, 'q'},
297c300
<               i = getopt_long(*argc, *argv, "c:de:fg:m:s:Svh", opts, NULL);
---
>               i = getopt_long(*argc, *argv, "c:de:fg:m:q:s:Svh", opts, NULL);
320a324,326
>               case 'q':
>                       quiet = 1;
>                       break;
456c462,463
<       vsyslog(level, fmt, args);
---
>       if ((level < LOG_INFO) || (!quiet))
>               vsyslog(level, fmt, args);


------------------

diffs to event.c

157c157
<       acpid_log(LOG_INFO, "%d rule%s loaded\n",
---
>       acpid_log(LOG_NOTICE, "%d rule%s loaded\n",
343c343
<       acpid_log(LOG_INFO, "%d client rule%s loaded\n",
---
>       acpid_log(LOG_NOTICE, "%d client rule%s loaded\n"
Comment 1 Jakub Moc (RETIRED) gentoo-dev 2007-09-02 18:54:01 UTC
(In reply to comment #0)
> I've submitted this to acpid.sourceforge.net as feature request 1786726. 

Yeah, that's where it belongs. Reopen if/once this patch has been accepted. Thanks.