Laptop mode fails to start without saying why

Bug #95247 reported by Steve Bergman
4
Affects Status Importance Assigned to Milestone
laptop-mode-tools (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Binary package hint: laptop-mode

I'm not sure how this might or might not apply to a fresh feisty beta install. I upgraded the edgy install on my compaq presario v2552us notebook to Herd 5 and am now fully updated, so I should have the equivalent of the beta.

Laptop mode fails to even try to start from the /etc/init.d/laptop-mode script because ENABLE_LAPTOP_MODE is set to false in /etc/default/acpi-support.

Setting it to true seems to fix the problem.

There is a warning in that file about how some systems can act strangely in laptop mode, and I can't remember if I enabled the laptop-mode service myself or not. So maybe this isn't even a bug, but a feature request.

Just wanted to report it.

This is my first report, and I would like to say "Great Going, Guys!" Between Ubuntu and companies like System76, we're going to change the world. :-)

Revision history for this message
Thomas Wolfe (tomwolfe) wrote :

same here with gutsy, would be nice if it would say why it does not start.

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

Some more verbosity or documentation seems to be needed, so that users don't have to reverse-engineer a whole chain of scripts and files to get it going.

Changed in laptop-mode-tools:
status: New → Confirmed
Revision history for this message
Tormod Volden (tormodvolden) wrote :

I filed a patch for the missing "sudo update-rc.d laptop-mode defaults 99" in bug #127273.

Anyway, rumours go that laptop-mode-tools is going to be ditched from Gutsy...

Revision history for this message
Jay Strict (jay-strict) wrote :

Also
/etc/init.d/laptop-mode status
fails to report anything. It just returns silently.

This and the original issue are due to a test for ENABLE_LAPTOP_MODE in line 32 in /etc/init.d./laptop-mode , which happens too early.
Rather this test should only occur in the start) and restart) cases, IMHO.

Oh, and I think that Bug #80979 is _not_ a duplicate of this bug, because this bug is fixed if ENABLE_LAPTOP_MODE is true, Bug #80979 ist not.

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

The point is that the /etc/init.d script is not meant to be a way to start and stop the "laptop mode". When AC adapters are (un)plugged etc, the /usr/sbin/laptop_mode script is run and turns on/off the mode (and adjusts settings) accordingly (only if laptop mode is enabled by the /var/run/laptop-mode-enabled flag). The init script is a hook to make sure this check is done also at boot, since the adapter can have been (un)plugged while the machine was off.

Additionally, it first creates the /var/run/laptop-mode-enabled flag at boot (if you have set ENABLE_LAPTOP_MODE in /etc/default/acpi-support). At shutdown the init script clears this flag, so that any later (un)plugging won't trigger any reconfigurations (even if ENABLE_LAPTOP_MODE is still true in the config file).

IMOH "/etc/init.d/laptop-mode status" should not say if laptop mode is currently on (we have /usr/sbin/laptop_mode status for this) but it should report whether laptop mode is enabled (by looking at the /var/run flag).

Revision history for this message
Shermozle (shermozle) wrote :

This is trivially easy, just give the user some hints as to why this isn't enabled by default rather than silently fail. Also, perhaps this should be enabled for the netbook-remix variant, since these all use more modern hardware?

Change this in /etc/init.d/laptop-mode:
# FIXME: this shouldn't be configured there
if [ -f /etc/default/acpi-support ]; then
       . /etc/default/acpi-support;
fi

to this:
# FIXME: this shouldn't be configured there
if [ -f /etc/default/acpi-support ]; then
       . /etc/default/acpi-support;
        echo "You need to set ENABLE_LAPTOP_MODE=true in /etc/default/acpi-support"
fi

Revision history for this message
Philip Muškovac (yofel) wrote :

You have my support on this, but the message should not be shown if it's actually enabled.

# FIXME: this shouldn't be configured there
if [ -f /etc/default/acpi-support ]; then
    . /etc/default/acpi-support;
    if ! $ENABLE_LAPTOP_MODE; then
        echo "You need to set ENABLE_LAPTOP_MODE=true in /etc/default/acpi-support"
    fi
fi

Revision history for this message
Philip Muškovac (yofel) wrote :

On second thought the right place to put the message is where the test for that is now:

if [ x$ENABLE_LAPTOP_MODE = xfalse ]; then
       echo "You need to set ENABLE_LAPTOP_MODE=true in /etc/default/acpi-support"
       exit 0;
fi

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.