This is the situation in intrepid, I think:

The script /etc/acpi/power.sh seems to be called whenever the AC power
is plugged in or removed, and it is also called at boot up (via the init
script /etc/init.d/acpi-support) and when resuming from suspend. This is
okay.

However, the script /etc/acpi/power.sh checks whether the power state
has actually changed, using the function checkStateChanged(). This
function does "exit 0" if the state has not changed. If the state has
changed, then the power.sh script runs all the scripts in either
/etc/acpi/battery.d or /etc/acpi/ac.d, as appropriate.

This works fine for plugging in and unplugging the power, and at resume
from suspend. It does not work at boot time, however, because the
checkStateChanged function is irrelevant at boot time. This is the
thought behind msrgi's modification. I think a simpler way to deal with
it is to change /etc/init.d/acpi-support by adding a line:

case "$1" in
  start)
    log_begin_msg "Checking battery state..."
    if [ -f "$POWERSTATE" ]; then rm "$POWERSTATE"; fi
    /etc/acpi/power.sh
   ...... etc ....

The result should be that the init script will always call the scripts
in either /etc/acpi/battery.d or /etc/acpi/ac.d on startup.

-- 
acpi scripts are only called on events
https://bugs.launchpad.net/bugs/108611
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to