Comment 5 for bug 95247

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).