don't have any laptop-mode-tools settings in /etc/default/acpi-support

Bug #244838 reported by ceg
54
This bug affects 2 people
Affects Status Importance Assigned to Milestone
acpi-support (Ubuntu)
Fix Released
Medium
Steve Langasek
laptop-mode-tools (Ubuntu)
Fix Released
Medium
Steve Langasek

Bug Description

Only thing left for laptop-mode-tools:

* remove the lines sourcing /etc/default/acpi-support (search the package source)

 Might very well just need to drop an ubuntu specific patch.

----
Old:
Laptop-mode won't be activated unless ENABLE_LAPTOP_MODE=true is also set in /etc/default/acpi-support. (/etc/init./laptop-mode, /usr/lib/pm-utils/sleep.d/96laptop-mode and /usr/lib/pm-utils/power.d/laptop-mode check for this)

Therefore two places exist in Ubuntu where disk-idleing (aka laptop-mode) needs to be enabled. The other is in /etc/laptop-mode/laptop-mode.conf.

It is suggested to separate the disk-idleing (aka laptop_mode) configuration from the acpi-support (button/event support) package and to remove this setting from /etc/default/acpi-support.
bug #244831, bug #244832, bug #244833, bug #244836
(Leaving laptop-mode.conf for that)

(The current laptop-mode disk-idleing approach seems to be a left-over from before the ubuntu-laptop-mode package was dropped for laptop-mode-tools.)

Revision history for this message
ceg (ceg) wrote :

There is now an overview about the related bugs in the wiki.
https://wiki.ubuntu.com/PowerManagement#head-ab94c99627b86e9fbb29a09d3316178269c3e764

Revision history for this message
Tormod Volden (tormodvolden) wrote :

It is enabled by default (for battery) in laptop-mode.conf. So you only need to enable it manually in /etc/defaulut/acpi-support. But I agree, this does not belong in the acpi-support configuration.

Changed in laptop-mode-tools:
status: New → Confirmed
description: updated
Revision history for this message
ceg (ceg) wrote : Re: laptop-mode needs to be activated in /etc/default/acpi-support

Yes, I think you are right. Since the laptop-mode messing has fortunately been removed from acpi-support the setting is obsoleted there and serves only for confusion.

Alexey wrote:

It's interesting to know that current acpi-support in Debian unstable (1.109-5) has this comment in /etc/default/acpi-support:

# Note: to enable "laptop mode" (to spin down your hard drive for longer
# periods of time), install the laptop-mode-tools package and configure
# it in /etc/laptop-mode/laptop-mode.conf.
#
# (Note to upgraders: earlier versions of the acpi-support package contained
# an option to enable/disable laptop mode. This option has never actually
# worked, and for that reason it has been removed.)
(https://bugs.launchpad.net/ubuntu/+source/acpi-support/+bug/250938/comments/5)

---

This issue can be fixed when laptop-mode-tools and acpi-support from Debian is merged.

package laptop-mode-tools:
/etc/init.d/laptop-mode: drop sourcing of /etc/default/acpi-support (another packages conffile)

package acpi-support:
/etc/default/acpi-support: remove the ENABLE_LAPTOP_MODE setting and don't supress the above comment.

Revision history for this message
ceg (ceg) wrote :

When resposibility is reestablished for /etc/laptop-mode/laptop-mode.conf the ENABLE_LAPTOP_MODE_ON_BATTERY=yes default from debian's laptop-mode package will and can enable laptop_mode when on batteries, no problem.

Package pm-utils has had a hacked laptop-tools script in hardy all the time that did just that.
See https://bugs.launchpad.net/ubuntu/+source/pm-utils/+bug/239419/comments/5

Revision history for this message
Tormod Volden (tormodvolden) wrote : Re: remove laptop-mode settings from /etc/default/acpi-support

I guess the right thing would be to instead have it disabled by default in /etc/laptop-mode/laptop-mode.conf, and stop looking in /etc/default/acpi-support. For upgrades, this means people who had enabled it in acpi-support will have to reenable it in laptop-mode.conf, unless we do some ugly magic. Maybe a pop-up warning during upgrade will do, or the suggested logic below?

old acpi-support, old laptop-mode.conf -> upgrade action - reason:

1. disabled, enabled -> rewrite to be off (to preserve behaviour) - this was the unmodified configuration in Ubuntu
2. enabled, disabled -> do nothing (default off) - the user had done what we'll do now
3. disabled, disabled -> do nothing (default off) - the user had turned it off at some point
4. enabled, enabled -> do nothing (leave on) - the user had turned it on

(I am only talking about _ON_BATTERY here, we don't touch _ON_AC which was off by default anyway)
More sophisticated would be to detect if the user ever edited the configuration files, and ask accordingly.

Note that we have to leave the setting in acpi-support until laptop-mode-tools performs the above logic, which it should do only once. Then acpi-support can itself remove its obsolete setting, but only after it knows acpi-support has been upgraded and done its logic.

Or just let people read the Release Notes properly as they should :)

Revision history for this message
Tormod Volden (tormodvolden) wrote :

/usr/sbin/laptop_mode actually checks /etc/default/laptop_mode for ENABLE_LAPTOP_MODE, so that would be the easy, less intrusive way to migrate it, without touching /etc/laptop-mode/laptop-mode.conf at all. On a default install this file doesn't exist until now (only on powerpc to disable it). So in what I wrote in the previous comment, replace latop-mode.conf with /etc/default/laptop-mode.

Revision history for this message
ceg (ceg) wrote :

Yes, /etc/default/laptop_mode seems more sane as a second config file for laptop-mode-tools.

As you mentioned in Bug #250935 we have to keep in mind that enabling the laptop-mode-tools by default is in fact a necessary change to fix the load cycling issue for example.

IMHO laptop-mode-tools needs to be enabled by default. (/etc/default/laptop_mode does provide a place to optionally disable this autoinstalled package alltogether.)

Whether laptop_mode (ENABLE_LAPTOP_MODE_ON_BATTERY) is enabled or not by default is another question.

Since hardy, as a userfriendly distro suitable for laptops, has allways set /proc/sys/vm/laptop_mode to 2 when on battery ("laptop-tools" script hacked into pm-utils) I'd tend to propose that the laptop-mode.conf default (_ON_BATTERY=1) can just be kept. It steps in for the pm-utils script that got removed in intrepid.

Enabling laptop-mode-tools can be considered a necessary bugfix change, and not entering /proc/sys/vm/laptop_mode on battery any more can be considered a regression.

Looks as this would also make much transition magic unnecessary. The comment that debian packages have in place might suffice.

Revision history for this message
Tormod Volden (tormodvolden) wrote :

With Feature Freeze coming on Thursday, it's about time to get this and related changes into Intrepid. Does anyone have time to come up with some debdiffs?

description: updated
Revision history for this message
Tormod Volden (tormodvolden) wrote :

I wonder if we can enable laptop-mode by default in Jaunty (ENABLE_LAPTOP_MODE). Does anyone have any bug references to machines that break when laptop-mode is enabled? With ENABLE_LAPTOP_MODE true, the defaults in /etc/laptop-mode/laptop-mode.conf is to only actually use laptop mode when on battery.

Revision history for this message
Michael Rooney (mrooney) wrote : Re: [Bug 244838] Re: remove laptop-mode settings from /etc/default/acpi-support

Last time I tried this with Hardy, the disks would turn off, but if I tried
to use the computer after not having done so in awhile, such as after being
on overnight, any activity would cause the disk I/O to thrash seemingly
indefinitely and the machine was unusable until a hard restart.

Steve Langasek (vorlon)
Changed in laptop-mode-tools (Ubuntu):
importance: Undecided → Medium
status: Confirmed → Triaged
Changed in acpi-support (Ubuntu):
status: New → Triaged
importance: Undecided → Medium
Revision history for this message
ceg (ceg) wrote : Re: remove laptop-mode settings from /etc/default/acpi-support

Micheal (Rooney), was that a desktop/server machine or a laptop on battery where the disk failed to spin up again?

Revision history for this message
ceg (ceg) wrote :

According to
https://bugs.launchpad.net/ubuntu/+source/pm-utils/+bug/239419/comments/5
the kernel's laptop_mode has been hardcoded to be enabled on battery all the time anyway.

So it should be fine to just remove checking ENABLE_LAPTOP_MODE
in /etc/default/acpi-support from /etc/init.d/laptop-mode, /usr/lib/pm-utils/sleep.d/96laptop-mode and /usr/lib/pm-utils/power.d/laptop-mode. And to remove that stanza from the /etc/default/acpi-support file.

Revision history for this message
Michael Rooney (mrooney) wrote : Re: [Bug 244838] Re: remove laptop-mode settings from /etc/default/acpi-support

On Wed, Dec 2, 2009 at 5:39 AM, ceg <email address hidden> wrote:
> Micheal (Rooney), was that a desktop/server machine or a laptop on
> battery where the disk failed to spin up again?

It was a laptop, on battery IIRC. It wasn't failing to spin up again
though; the drive came back, the IO was just terribly thrashing
indefinitely so nothing could actually happen

Revision history for this message
Steve Langasek (vorlon) wrote : Re: remove laptop-mode settings from /etc/default/acpi-support

This will be removed from acpi-support tools only once update-manager has had a quirk added to propose removal of laptop-mode-tools on upgrade from karmic. We do *not* want laptop_mode enabled for users by default.

Revision history for this message
ceg (ceg) wrote :

This bug as about the ENABLE_LAPTOP_MODE having nothing to do in package acpi-support (another package).
(It was introduced there because some ubuntu dev once stuck an old unmaintained laptop_mode scipt into acpi-support instead of using proper laptop-mode-tools package, and later laptop-mode-tools got patched to use that setting.)

Removing the setting will *not* enable laptop-mode by default, because it is still checking if it is enabled in /etc/default/laptop-mode and /etc/laptop-mode/laptop-mode.conf (where it is enabled only if on battery).

What's still left from this in order to reduce the number of ubuntu mispatches is:

acpi-support:
 * Simply remove that setting form /etc/default/acpi-support

 If the laptop-mode-tools package does not get installed by default any more, is a separate question.

laptop-mode-tools:
 * The package might wrongly restrict the installation of /etc/default/laptop-mode only to powerpc instead of restricting the install of /etc/power only to powerpc. (->Bug #491804 ) (Still, if the file is not there ENABLE_LAPTOP_MODE won't be true)

 * eventually remove checking of /etc/default/acpi-support

-----
About "kernel's laptop_mode has been hardcoded to be enabled on battery".
This was true with that other (non-laptop-mode-tools package) laptop-mode script as long as it was packaged with acpi-support instead of relying on laptop-mode-tools (but conflicting with it). Bug #239419

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

This bug was fixed in the package acpi-support - 0.131

---------------
acpi-support (0.131) lucid; urgency=low

  * events/lenovo-undock, undock.sh: new scripts to handle the Fn+F9 "undock"
    button on ThinkPads, which unfortunately nothing else handles. Thanks
    to Jeffrey Baker for the first implementation. LP: #18864.
  * /etc/default/acpi-support: laptop-mode-tools is no longer installed by
    default, so don't override its setting from here. LP: #244838, #490186.
 -- Steve Langasek <email address hidden> Mon, 14 Dec 2009 11:04:22 -0800

Changed in acpi-support (Ubuntu):
status: Triaged → Fix Released
Revision history for this message
ceg (ceg) wrote :

Now the only thing left for laptop-mode-tools:

* remove the lines sourcing /etc/default/acpi-support (search the package source)

ceg (ceg)
summary: - remove laptop-mode settings from /etc/default/acpi-support
+ don't have any laptop-mode-tools settings in /etc/default/acpi-support
description: updated
description: updated
Revision history for this message
ceg (ceg) wrote :

Concerning the related blueprint: "Integration of the laptop-mode-tools package with the rest of the default system".

 * It looks less like integration and more like droping plus reimplementation and repeating errors. laptop-mode-tools is a very well maintained package widely used on debian laptops. Mangling the three tasks of power management (https://wiki.ubuntu.com/PowerManagement) into one (acpi-support) already failed miserably once. Use small tools specialized for its task. Why not adeqately calling the laptop-mode-tools script from pm-utils so that they do not trip over each other. (possibly deactivating/changing and properly commenting some of the laptop-mode-tools options) But dropping laptop-mode-tools from the distribution really does not look like a solution at all, much more if crucial laptop_mode (disk idleing) gets no support.

 * Deliberately buffering disk writes with laptop-mode-tools of course means loosing data on crashes (but not on battery run out). A reason not to touch (disk idleing / laptop_mode) with pm-tools but make laptop-mode-tools work in a pm-tools environment.

 * ext4 is supported by laptop-mode-tools since 1.47-1.

Revision history for this message
ceg (ceg) wrote :

The laptop-mode freeze bug actually seems fixed but status not updated. (Bug #12483, debbugs #426548)

Steve Langasek (vorlon)
Changed in laptop-mode-tools (Ubuntu):
assignee: nobody → Steve Langasek (vorlon)
Steve Langasek (vorlon)
Changed in acpi-support (Ubuntu):
assignee: nobody → Steve Langasek (vorlon)
Steve Langasek (vorlon)
Changed in laptop-mode-tools (Ubuntu):
status: Triaged → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package laptop-mode-tools - 1.52-1ubuntu2

---------------
laptop-mode-tools (1.52-1ubuntu2) lucid; urgency=low

  * etc/init.d/laptop-mode, usr/lib/pm-utils/sleep.d/99laptop-mode,
    usr/lib/pm-utils/power.d/laptop-mode: stop checking
    /etc/default/acpi-support for disabling of laptop-mode-tools; this isn't
    policy that should be set by acpi-support. LP: #244838.
  * promote sdparm suggests back to recommends, now that laptop-mode-tools
    is in universe.
  * stop autocreating /etc/default/laptop-mode-tools on powerpc since we
    don't use it anymore, and clean up any files that we did automatically
    create.
  * etc/laptop-mode/laptop-mode.conf: don't diverge from Debian on the
    hard drive spindown time
  * finally, revert the changes to laptop-mode itself so that it runs as
    designed when it's installed, and check for ENABLE_LAPTOP_MODE != false
    instead of ENABLE_LAPTOP_MODE = true.
 -- Steve Langasek <email address hidden> Fri, 26 Feb 2010 19:09:22 -0800

Changed in laptop-mode-tools (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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