Hi there.

 > After upgrading to the mentioned version of apmd (to have
 > pre-suspend and post-resume support) apmd does now 2 annoying
 > things:

 > 1. fills up syslog with messages like

 > Jul  4 14:39:32 galaxy apmd[128]: Charge: -0.30%/min (0:03) 0:03 (99% 3:10)
 > Jul  4 14:39:49 galaxy apmd[128]: Charge: -0.28%/min (0:04) 0:04 (99% 3:12)
 > Jul  4 14:40:06 galaxy apmd[128]: Charge: -0.26%/min (0:04) 0:04 (99% 3:06)
 > Jul  4 14:40:22 galaxy apmd[128]: Charge: -0.24%/min (0:04) 0:04 (99% 3:04)

 > This goes on for a while :-\ Unfortunately it is repeated every
 > few seconds, so syslog grows very quickly.

Here's the result of grep'ing my /var/log/messages for apmd on my
laptop:

 Q> Jul  4 19:31:12 Shuttle apmd[86]: Battery: * * * (100% 2:36)
 Q> Jul  4 19:31:22 Shuttle apmd[86]: pre_suspend: '/usr/bin/run-parts 
/etc/apmd/suspend.d' returns 0
 Q> Jul  4 19:47:17 Shuttle apmd[86]: Charge: * * * (-1% 0:01)
 Q> Jul  4 19:47:17 Shuttle apmd[86]: Resume after 00:15:55 (-1% 0:01)
 Q> Jul  4 19:47:18 Shuttle apmd[86]: post_resume: '/usr/bin/run-parts 
/etc/apmd/resume.d' returns 0
 Q> Jul  4 21:28:06 Shuttle apmd[86]: pre_suspend: '/usr/bin/run-parts 
/etc/apmd/suspend.d' returns 0
 Q> Jul  5 01:18:17 Shuttle apmd[86]: Resume after 03:50:11 (-1% 0:01)
 Q> Jul  5 01:18:17 Shuttle apmd[86]: post_resume: '/usr/bin/run-parts 
/etc/apmd/resume.d' returns 0
 Q> Jul  8 02:02:54 Shuttle apmd[86]: pre_suspend: '/usr/bin/run-parts 
/etc/apmd/suspend.d' returns 0
 Q> Jul  8 02:38:05 Shuttle apmd[86]: Resume after 00:35:11 (100% 2:36)
 Q> Jul  8 02:38:05 Shuttle apmd[86]: post_resume: '/usr/bin/run-parts 
/etc/apmd/resume.d' returns 0

As you can see, there's several suspend/resume cycles in there...

 > 2. Once fallen beyond 51% in offline status it starts sending
 > wall messages with the Battery Low notification even apmd is
 > running with '-w 5 -W" option.

 > # cat /etc/sysconfig/apmd 
 > SCRIPTDIR=/usr/local/sbin
 > APMD_OPTIONS="-p 10 -w 5 -W -s $SCRIPTDIR/suspend -r $SCRIPTDIR/resume"
 > # ps uawx|grep apmd
 > root       128  0.0  0.5  1076  368 ?        S    16:23   0:00   /usr/sbin/apmd -p 
 >10 -w 5 -W -s /usr/local/sbin/suspend -r /usr/loca

Mine says...

 Q> # cat /etc/sysconfig/apmd
 Q> APMD_OPTIONS="-p 10 -w 5 -W"

In addition, the relevant part of /etc/rc.d/init.d/apmd reads as
follows:

 Q> case "$1" in
 Q>     start)
 Q>         echo -n "Starting up APM daemon: "
 Q>         test -r "$CONFIG" && . "$CONFIG"
 Q>         daemon /usr/sbin/apmd $APMD_OPTIONS                 \
 Q>             -r '/usr/bin/run-parts /etc/apmd/resume.d'      \
 Q>             -s '/usr/bin/run-parts /etc/apmd/suspend.d'
 Q>         touch /var/lock/subsys/apmd
 Q>         echo
 Q>         ;;
 Q>     stop)
 Q>         echo -n "Shutting down APM daemon: "
 Q>         killproc apmd
 Q>         rm -f /var/lock/subsys/apmd
 Q>         echo
 Q>         ;;

It's slightly different to yours, but not in ways that matter...

 > I hope someone can help me on these points because it really gets
 > annoying in the meantime :-\ TIA!

 > PS: System is Linux 2.2.10, RedHat-6.0 on a Toshiba Sattellite 4000CDT.

System here is RedHat 5.2 with kernel 2.2.6 on a Toshiba T2110. I've
not yet got round to reinstalling with RedHat 6.0 here, although both
my desktops are running under 6.0...

Best wishes from Riley.

+----------------------------------------------------------------------+
| There is something frustrating about the quality and speed of Linux  |
| development, ie., the quality is too high and the speed is too high, |
| in other words, I can implement this XXXX feature, but I bet someone |
| else has already done so and is just about to release their patch.   |
+----------------------------------------------------------------------+
 * ftp://ftp.MemAlpha.cx/pub/rhw/Linux
 * http://www.MemAlpha.cx/kernel.versions.html

Reply via email to