ACPI Cleanup: Remove ac.d and battery.d

Bug #385949 reported by Michael Terry
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
acpi-support (Ubuntu)
Fix Released
Medium
Unassigned
anacron (Ubuntu)
Fix Released
Undecided
Martin Pitt
devicekit-power (Ubuntu)
Fix Released
Undecided
Martin Pitt
distributed-net (Ubuntu)
Fix Released
Undecided
James E. Stark
pm-utils (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Binary package hint: acpi-support

As part of the acpi-support cleanup effort (https://blueprints.edge.launchpad.net/ubuntu/+spec/foundations-karmic-power-management), I figure we can get rid of ac.d and battery.d (like we recently got rid of suspend.d and resume.d -- see bug 366119).

There are 3 packages in the archive that install files there:
acpi-support: hdparm.sh
anacron: anacron.sh
distributed-net: distributed-net

Anacron also installs a script in pm-utils, so the only work there is to optionally not install into /etc/acpi.

acpi-support's hdparm script needs to be put in pm-utils (it already has a sleep.d version of it, just needs a power.d one too).

distributed-net's script also needs porting.

Changed in distributed-net (Ubuntu):
assignee: nobody → James E. Stark (jstark-ieee)
Revision history for this message
Michael Terry (mterry) wrote :

Here's the debdiff to make pm-utils ship a hdparm script for power.d (eventually obsoleting acpi-support's hdparm script).

Revision history for this message
James E. Stark (jstark-ieee) wrote :

I have no objections to replacing the battery.d and ac.d scripts in distributed-net. If we remove these what functionality would replace them. In the case of distributed-net these scripts serve to shutdown dnetc when the system transfers to battery and to restart dnetc when the system transitions back to ac power. Since dnetc by design drives the CPU to 100% load, removing the scripts and not replacing them isn't an option, since that would kill the batteries on the effected systems very quickly.

Revision history for this message
Michael Terry (mterry) wrote :

Hi, James! The goal is to use pm-utils instead. So installing a script to /usr/lib/pm-utils/power.d/ that accepts the arguments 'true' or 'false' (true means on battery, false means on AC) is the idea.

You can test such scripts by running 'pm-powersave'.

I believe the idea is that pm-powersave is run automatically when switching from battery to AC. But that's not happening for me. So either I have some bug or we have yet to plug pm-powersave in somehow. I have to research how that's supposed to work.

Revision history for this message
Michael Terry (mterry) wrote :

OK, I've linked this bug to an acpi-support branch where I've dropped ac.d and battery.d. It's power.sh script now only runs pm-powersave if there's no power manager already running.

This works fine for Jaunty, but in Karmic, gnome-power-manager and devicekit-power don't actually call pm-powersave when a battery event happens. So I'm investigating if that's just a missing feature that will get added or if we need to call pm-powersave even when g-p-m is up.

Revision history for this message
Michael Terry (mterry) wrote :

I updated the acpi-support branch to also run pm-powersave in GNOME. The DeviceKit-power folks seem to intentionally not want to run it, considering that it's the wrong approach (ondemand and such should be good enough they say). But pm-powersave also runs the power.d scripts... So we still want it.

For now, I've made this change so that pm-powersave still gets called and we don't have regressions. But in the future, hopefully some solution will present itself.

Martin Pitt (pitti)
Changed in anacron (Ubuntu):
assignee: nobody → Martin Pitt (pitti)
status: New → In Progress
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package anacron - 2.3-13.1ubuntu8

---------------
anacron (2.3-13.1ubuntu8) karmic; urgency=low

  * Move debian/anacron.postinst to debian/anacron.preinst and adapt $1 checks
    accordingly. This properly cleans up the old conffiles. (LP: #385949)

 -- Martin Pitt <email address hidden> Fri, 26 Jun 2009 08:51:44 +0200

Changed in anacron (Ubuntu):
status: In Progress → Fix Released
Revision history for this message
Martin Pitt (pitti) wrote :

I'll sponsor pm-utils, thanks!

I agree that we still need something to replace the pm-powersave calling from acpi-support. I agree that devicekit-power is the right place for it. Perhaps in the upstream discussions they were not fully aware of the use case like distributed-net?

Changed in pm-utils (Ubuntu):
status: New → Fix Committed
Changed in distributed-net (Ubuntu):
status: New → Triaged
Revision history for this message
Martin Pitt (pitti) wrote :

Adding a dk-power task to make it call pm-powersave when the battery/AC state changes.

Changed in devicekit-power (Ubuntu):
status: New → Triaged
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package pm-utils - 1.2.5-2ubuntu4

---------------
pm-utils (1.2.5-2ubuntu4) karmic; urgency=low

  * debian/rules, debian/95hdparm-apm: Install hdparm script to power.d
    as well. LP: #385949

 -- Michael Terry <email address hidden> Thu, 11 Jun 2009 11:43:55 -0400

Changed in pm-utils (Ubuntu):
status: Fix Committed → Fix Released
Revision history for this message
Martin Pitt (pitti) wrote :
Changed in devicekit-power (Ubuntu):
assignee: nobody → Martin Pitt (pitti)
status: Triaged → In Progress
Revision history for this message
Michael Terry (mterry) wrote :

Now that devicekit-power will support pm-powersave, I took out the code I added to my branch to call pm-powersave even when g-p-m is running. My acpi-support branch is ready for review.

The last missing piece would be just getting the new dk-p code merged.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package devicekit-power - 008-1ubuntu1

---------------
devicekit-power (008-1ubuntu1) karmic; urgency=low

  * Add pm-powersave.patch: Call pm-powersave (similar to what acpi-support
    did in the past). Patch taken from git head. (LP: #385949)

 -- Martin Pitt <email address hidden> Fri, 26 Jun 2009 16:15:24 +0200

Changed in devicekit-power (Ubuntu):
status: In Progress → Fix Released
Revision history for this message
James E. Stark (jstark-ieee) wrote :

Distributed-net 2.9103.509-1 went into debian/unstable yesterday. Once it migrates to testing I'll get 2.9103.509-2 uploaded which migrate distributed-net's power management to pm-utils.

I agree that distributed.net is a bit of an odd use case. What applications aside from distributed-net, bionc and the like do you absolutely want to shutdown when you transition to battery power? I'm not surprised that this one was missed.

Changed in distributed-net (Ubuntu):
status: Triaged → In Progress
Steve Langasek (vorlon)
Changed in acpi-support (Ubuntu):
importance: Undecided → Medium
status: New → Fix Committed
Michael Terry (mterry)
Changed in acpi-support (Ubuntu):
status: Fix Committed → Fix Released
Revision history for this message
Dylan Aïssi (daissi) wrote :

It's possible to close this bug by sync distributed-net 2.9105.511b-1 from debian unstable.

Revision history for this message
Dylan Aïssi (daissi) wrote :

Fixed in Maverick!

distributed-net (2.9107.516-1) unstable; urgency=low

  * Bump Standards-Version to 3.8.4
  * New upstream release 2.9107.516 on amd64, x86, ppc, mipsel and sparc.
  * Really close #235152 and fix the typo in the changelog (Closes: #235152)
  * Switch to dpkg-source 3.0 (quilt) format
  * Adjust the .orig.tgz to contin unpacked versions of the upstream
    distribution tarballs. This allows dpkg-source to apply the patch
    properly.
  * Remove the dpatch section from Readme.source.

distributed-net (2.9105.511b-1) unstable; urgency=low

  * Bump Standards-Version to 3.8.3
  * New upstream 2.9105.511b for ppc (Closes: #235152)
  * New upstream 2.9104.510 for i386
  * Really drop hppa32
  * Adjust debin/watch to allow for letters in version numbers
  * Remove all apm/acpi support is distributed.net is supposed to be
    able to handle this itself. (LP: 385949)
  * Add a README.source

distributed-net (2.9103.509-1) unstable; urgency=low

  * New upstream version for i386, amd64, armel, and ia64 (Closes: #518015)
  * Acknowledge NMU.
  * Drop arm as it is now depricated in Debian.
  * Drop hppa since it requires libstdc++.so.3 which is long gone.
  * Bumped Standards-Version to 3.8.2 no changes
  * Make the logfile to be readable by group adm (LP: 155823)
  * Change the realtime scheduling policy to SCHED_BATCH (LP: 307826)
  * Use invoke-rc.d to call the init script instead of calling it directly
 -- Ubuntu Archive Auto-Sync <email address hidden> Sun, 09 May 2010 21:04:16 +0100

Changed in distributed-net (Ubuntu):
status: In Progress → Fix Released
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.