[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: ACPI and anacron

Hash: SHA1

Am Sonntag, 10. August 2003 12:14 schrieb Matteo Vescovi:

> I've got a problem: since I upgraded from APM to ACPI, anacron doesn't work
> properly anymore. At boot time, the /etc/init.d/anacron script is not able
> to test the presence of "on_ac_power"; so it supposes that I'm always on
> battery power and the message is the same everyday:
> "Starting anac(h)ronistic cron: deferred while on battery power."
> What should I do now? The comment inside the anacron script says it only
> tests the presence of AC power thru the APM module: what about ACPI?

The anacron start-script uses the script /usr/bin/on_ac_power to check whether 
we're on battery power. The fault lies there as it checks for AC adapters in 
/proc/acpi/0/. At my system the related acpi files are in 
/proc/acpi/ac_adapter/. So my workaround is: I changed the acpi path from 
/proc/acpi/0/ to /proc/acpi/ac_adapter/ in /usr/bin/on_ac_power. Maybe the 
path varies in different systems, I don't know. So you should check whether 
/proc/acpi/ac_adapter is the correct path at your system, or whether the 
related files are somewhere else in /proc/acpi/.
Another workaround is, if you're not running on a laptop, to skip the battery 
check by commenting out the related lines in /etc/init.d/anacron. These are 
the lines beginning with
    if test -x /usr/bin/on_ac_power (line 11 at my version)
and ending with
    fi (line 19, the second one, which finishes the if-construction in line 

Btw, although the comment in /etc/init.d/anacron says so not only apm is 
checked but also acpi and pmu.


- -- 
Get my GnuPG-Key with:
gpg --keyserver search.keyserver.net --recv-keys 6D3C4E34
Key fingerprint = A995 DAC2 7AFD A31E C5E6  F92A ACEB 185C 6D3C 4E34
jabber ID: casimir@jabber.org
Version: GnuPG v1.2.2 (GNU/Linux)


Reply to: