Table of Contents

Laptop-Mode

Because I have to do this very often, I write down the steps to configure laptop_mode the way I want here.
This also replaces the former (and unfortunately lost) entry for letting my servers hard disks spin down. Note that many of the laptop_mode features even work on non ACPI-aware computers (like my server) but you have to start it manually.

Edit laptop-mode configuration

On Ubuntu 7.04, the configuration file for laptop-mode is
/etc/laptop-mode/laptop-mode.conf

ENABLE_LAPTOP_MODE_ON_BATTERY=1
ENABLE_LAPTOP_MODE_ON_AC=1
LM_BATT_MAX_LOST_WORK_SECONDS=900
LM_AC_MAX_LOST_WORK_SECONDS=600
CONTROL_HD_IDLE_TIMEOUT=1
LM_AC_HD_IDLE_TIMEOUT_SECONDS=600
LM_BATT_HD_IDLE_TIMEOUT_SECONDS=20
NOLM_HD_IDLE_TIMEOUT_SECONDS=7200
CONTROL_NOATIME=1

Syslog

sudo /usr/sbin/lm-syslog-setup

Enable Laptop Mode

Is it running?

When the file contains a non-zero value, laptop mode is currently running.

cat /proc/sys/vm/laptop_mode

Start Laptop Mode

This starts laptop-mode right now but it will still consider ENABLE_LAPTOP_MODE_ON_BATTERY and ENABLE_LAPTOP_MODE_ON_AC from the config file.

sudo laptop_mode start
# or
sudo /etc/init.d/laptop-mode restart

If you have the problem that laptop-mode runs when you execute laptop_mode start, but it is not running after startup, then you should check the point below:

Enable Laptop Mode

This enables Laptop Mode on your Ubuntu 7.04 machine. The next time a power state will change (ac plugged in or running on battery), laptop mode will do what you configured.
In /etc/default/acpi-support, look for this line:

# Switch to laptop-mode on battery power - off by default as it causes odd
# hangs on some machines
ENABLE_LAPTOP_MODE=true

Links

A good article about Laptop-Mode can be found here: Linuxjournal.com
The Laptop-Mode FAQ can be found here: Laptop-Mode FAQ