on_ac_power script returns 255 during boot

Bug #49240 reported by Erik de Castro Lopo
8
Affects Status Importance Assigned to Milestone
powermgmt-base (Ubuntu)
Triaged
Low
Unassigned
Hardy
Won't Fix
Medium
Unassigned

Bug Description

Binary package hint: powermgmt-base

Machine is a Dell Latittude X1 running Dapper with a stock 2.6.15-23-686 kernel.

When booting on battery power, the on_ac_power script fails with an error code of 255. This has the result of allowing fsck's to occur during bootup on battey which is undesirable.

Revision history for this message
Robert Collins (lifeless) wrote :

I've confirmed this. My guess is that acpid is not up with the right modules when the checkfs/checkrootfs calls occur... mjg59 confirms this - the battery and ac modules need to be loaded for this script to work.

Changed in powermgmt-base:
status: Unconfirmed → Confirmed
description: updated
Revision history for this message
Matthew Garrett (mjg59) wrote :

Modules need to be loaded earlier

Revision history for this message
Erik de Castro Lopo (erikd) wrote :

A colleague of mine (Peter Miller) went to the trouble of debugging this further.

He found that by adding:

        battery
        ac
        sbs

to the file /etc/initramfs-tools/modules and then running the command:

        sudo update-initramfs -u

fixed the problem on his laptop.

I tried the same fix on my laptop and tested it by using tune2fs to temporarily set the max-mount-counts to 2 and then rebooted the machine a couple of times to verify.

Considering this is such an easy fix, it would be nice if this could be rolled into an existing package (say laptop-detect or laptop-mode-tools) or as part of the installation procedure.

Daniel Hahler (blueyed)
Changed in acpid:
importance: Undecided → Medium
status: Confirmed → Triaged
Revision history for this message
Loïc Minier (lool) wrote :

/sbin/on_ac_power is in powermgmt-base, so I'm reassigning this bug over there.

Of course the easiest and fastest case is to build the modules in the kernel; that's the case in jaunty but doesn't help hardy nor custom kernels.

On my system, the aforementioned modules are loaded automatically during boot even when not specified in /etc/default/acpid, so it's probably just a race that on_ac_power needs the modules loaded. I think on_ac_power could be improved to test for ACPI support and modprobe the relevant modules if the information is not present yet (just like we load modules to find the rootfs).

Changed in acpid:
importance: Medium → Low
Revision history for this message
Rolf Leggewie (r0lf) wrote :

Hardy has seen the end of its life and is no longer receiving any updates. Marking the Hardy task for this ticket as "Won't Fix".

Changed in powermgmt-base (Ubuntu Hardy):
status: Triaged → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.