Laptop-mode: Failed

Hey there
I recently installed laptop-mode-tools on my dell vostro 1520. I seems to work pretty good, however my error log shows me "laptop-mode: Failed". So my question is now, what does this mean an what could cause this error?
Below is a verbose output of a laptop-mode start process:
Nov 7 10:17:49 localhost laptop-mode: Determining power state from /sys/class/power_supply/ACAD/online.
Nov 7 10:17:49 localhost laptop-mode: Not trying other options, already found a power supply.
Nov 7 10:17:49 localhost laptop-mode: Battery level polling is disabled.
Nov 7 10:17:49 localhost laptop-mode: Prelim lock acquisition on descriptor 8 with pid 3028
Nov 7 10:17:49 localhost laptop-mode: Prelim lock acquisition on descriptor 9 with pid 3028
Nov 7 10:17:49 localhost laptop-mode: Now invoking lmt_main_function with arguments -- auto
Nov 7 10:17:49 localhost laptop-mode: On AC power: Deactivating, because ENABLE_LAPTOP_MODE_ON_AC is not set.
Nov 7 10:17:49 localhost laptop-mode: Laptop mode
Nov 7 10:17:49 localhost laptop-mode: Checking if desired state is different from current state.
Nov 7 10:17:49 localhost laptop-mode: enabled, not active
Nov 7 10:17:49 localhost laptop-mode: Invoking module /usr/share/laptop-mode-tools/modules/ac97-powersave.
Nov 7 10:17:49 localhost laptop-mode: AC97 power saving is not available. Perhaps CONFIG_SND_AC97_POWER_SAVE option
Nov 7 10:17:49 localhost laptop-mode: is not set in the kernel config, or the snd_ac97_codec module is not loaded.
Nov 7 10:17:49 localhost laptop-mode: Invoking module /usr/share/laptop-mode-tools/modules/battery-level-polling.
Nov 7 10:17:49 localhost laptop-mode: Battery level polling is disabled.
Nov 7 10:17:49 localhost laptop-mode: Invoking module /usr/share/laptop-mode-tools/modules/bluetooth.
Nov 7 10:17:49 localhost laptop-mode: Invoking module /usr/share/laptop-mode-tools/modules/configuration-file-control.
Nov 7 10:17:49 localhost laptop-mode: Invoking module /usr/share/laptop-mode-tools/modules/cpufreq.
Nov 7 10:17:49 localhost laptop-mode: Setting CPU maximum frequency for cpu /sys/devices/system/cpu/cpu0 to 2534000.
Nov 7 10:17:49 localhost laptop-mode: Executing: echo 2534000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
Nov 7 10:17:49 localhost laptop-mode: Setting CPU minimum frequency for cpu /sys/devices/system/cpu/cpu0 to 800000.
Nov 7 10:17:49 localhost laptop-mode: Executing: echo 800000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
Nov 7 10:17:49 localhost laptop-mode: Setting CPU frequency governor for cpu /sys/devices/system/cpu/cpu0 to ondemand.
Nov 7 10:17:49 localhost laptop-mode: Executing: echo ondemand > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
Nov 7 10:17:49 localhost laptop-mode: Not setting CPU ignore_nice_load for cpu /sys/devices/system/cpu/cpu0.
Nov 7 10:17:49 localhost laptop-mode: File /sys/devices/system/cpu/cpu0/cpufreq/ondemand/ignore_nice_load does not exist.
Nov 7 10:17:49 localhost laptop-mode: Setting CPU maximum frequency for cpu /sys/devices/system/cpu/cpu1 to 2534000.
Nov 7 10:17:49 localhost laptop-mode: Executing: echo 2534000 > /sys/devices/system/cpu/cpu1/cpufreq/scaling_max_freq
Nov 7 10:17:49 localhost laptop-mode: Setting CPU minimum frequency for cpu /sys/devices/system/cpu/cpu1 to 800000.
Nov 7 10:17:49 localhost laptop-mode: Executing: echo 800000 > /sys/devices/system/cpu/cpu1/cpufreq/scaling_min_freq
Nov 7 10:17:49 localhost laptop-mode: Setting CPU frequency governor for cpu /sys/devices/system/cpu/cpu1 to ondemand.
Nov 7 10:17:49 localhost laptop-mode: Executing: echo ondemand > /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor
Nov 7 10:17:49 localhost laptop-mode: Not setting CPU ignore_nice_load for cpu /sys/devices/system/cpu/cpu1.
Nov 7 10:17:49 localhost laptop-mode: File /sys/devices/system/cpu/cpu1/cpufreq/ondemand/ignore_nice_load does not exist.
Nov 7 10:17:49 localhost laptop-mode: Setting CPU ignore_nice_load for all cpus
Nov 7 10:17:49 localhost laptop-mode: Executing: echo 0 > /sys/devices/system/cpu/cpufreq/ondemand/ignore_nice_load
Nov 7 10:17:49 localhost laptop-mode: Invoking module /usr/share/laptop-mode-tools/modules/dpms-standby.
Nov 7 10:17:49 localhost laptop-mode: Determining Xauthority for display 0
Nov 7 10:17:49 localhost laptop-mode: Set screen :0 for the user roman to standby in 1200 s, suspend in 1500 s, powerdown in 1800 s using Xauthority /home/roman/.Xauthority
Nov 7 10:17:49 localhost laptop-mode: Invoking module /usr/share/laptop-mode-tools/modules/eee-superhe.
Nov 7 10:17:49 localhost laptop-mode: Control file is /sys/devices/platform/eeepc/cpufv
Nov 7 10:17:49 localhost laptop-mode: Platform does not support SuperHe
Nov 7 10:17:49 localhost laptop-mode: Invoking module /usr/share/laptop-mode-tools/modules/ethernet.
Nov 7 10:17:49 localhost laptop-mode: ethernet: /sys/devices/pci0000:00/0000:00:1c.1/0000:08:00.0/net/eth0
Nov 7 10:17:49 localhost laptop-mode: ethernet: /sys/devices/pci0000:00/0000:00:1c.1/0000:08:00.0
Nov 7 10:17:49 localhost laptop-mode: /usr/share/laptop-mode-tools/modules/ethernet: line 74: ethtool: command not found
Nov 7 10:17:49 localhost laptop-mode: Could not enable wakeup-on-LAN for eth0
Nov 7 10:17:49 localhost laptop-mode: /usr/share/laptop-mode-tools/modules/ethernet: line 135: ethtool: command not found
Nov 7 10:17:49 localhost laptop-mode: Could not set auto-negotiation to on for eth0
Nov 7 10:17:49 localhost laptop-mode: /usr/share/laptop-mode-tools/modules/ethernet: line 145: ethtool: command not found
Nov 7 10:17:49 localhost laptop-mode: Could not restore speed for eth0
Nov 7 10:17:49 localhost laptop-mode: Invoking module /usr/share/laptop-mode-tools/modules/exec-commands.
Nov 7 10:17:49 localhost laptop-mode: Executing comand
Nov 7 10:17:49 localhost laptop-mode: Executing comand
Nov 7 10:17:49 localhost laptop-mode: Executing comand
Nov 7 10:17:49 localhost laptop-mode: Executing comand
Nov 7 10:17:49 localhost laptop-mode: Executing comand
Nov 7 10:17:49 localhost laptop-mode: Executing comand
Nov 7 10:17:49 localhost laptop-mode: Executing comand
Nov 7 10:17:49 localhost laptop-mode: Executing comand
Nov 7 10:17:49 localhost laptop-mode: Executing comand
Nov 7 10:17:49 localhost laptop-mode: Executing comand
Nov 7 10:17:49 localhost laptop-mode: Invoking module /usr/share/laptop-mode-tools/modules/hal-polling.
Nov 7 10:17:49 localhost laptop-mode: Invoking module /usr/share/laptop-mode-tools/modules/hdparm.
Nov 7 10:17:49 localhost laptop-mode: Setting powermanagement on drives to 254.
Nov 7 10:17:49 localhost laptop-mode: Querying /dev/sda media type using udevinfo:
Nov 7 10:17:49 localhost laptop-mode: type 'disk' on bus 'ata' detected
Nov 7 10:17:49 localhost laptop-mode: Querying /dev/sda media type using udevinfo:
Nov 7 10:17:49 localhost laptop-mode: type 'disk' on bus 'ata' detected
Nov 7 10:17:49 localhost laptop-mode: Executing: hdparm -B 254 /dev/sda
Nov 7 10:17:49 localhost laptop-mode:
Nov 7 10:17:49 localhost laptop-mode: Setting spindown timeout on drives to 7200 seconds.
Nov 7 10:17:49 localhost laptop-mode: (hdparm configuration value = 244.)
Nov 7 10:17:49 localhost laptop-mode: Querying /dev/sda media type using udevinfo:
Nov 7 10:17:49 localhost laptop-mode: type 'disk' on bus 'ata' detected
Nov 7 10:17:49 localhost laptop-mode: Querying /dev/sda media type using udevinfo:
Nov 7 10:17:49 localhost laptop-mode: type 'disk' on bus 'ata' detected
Nov 7 10:17:49 localhost laptop-mode: Executing: hdparm -S 244 /dev/sda
Nov 7 10:17:49 localhost laptop-mode:
Nov 7 10:17:49 localhost laptop-mode: Invoking module /usr/share/laptop-mode-tools/modules/intel-hda-powersave.
Nov 7 10:17:49 localhost laptop-mode: Intel HDA power save mode disabled.
Nov 7 10:17:49 localhost laptop-mode: Intel HDA Controller power save set to N.
Nov 7 10:17:49 localhost laptop-mode: Invoking module /usr/share/laptop-mode-tools/modules/intel-sata-powermgmt.
Nov 7 10:17:49 localhost laptop-mode: Intel SATA link power saving set to max_performance for /sys/class/scsi_host/host0/link_power_management_policy.
Nov 7 10:17:49 localhost laptop-mode: Intel SATA link power saving set to max_performance for /sys/class/scsi_host/host1/link_power_management_policy.
Nov 7 10:17:49 localhost laptop-mode: Intel SATA link power saving set to max_performance for /sys/class/scsi_host/host2/link_power_management_policy.
Nov 7 10:17:49 localhost laptop-mode: Intel SATA link power saving set to max_performance for /sys/class/scsi_host/host3/link_power_management_policy.
Nov 7 10:17:49 localhost laptop-mode: Invoking module /usr/share/laptop-mode-tools/modules/laptop-mode.
Nov 7 10:17:49 localhost laptop-mode: Executing: echo 0 > /proc/sys/vm/laptop_mode
Nov 7 10:17:49 localhost laptop-mode: Adjusting 2.6+ kernel parameters to disable laptop mode.
Nov 7 10:17:49 localhost laptop-mode: Executing: echo 500 > /proc/sys/vm/dirty_writeback_centisecs
Nov 7 10:17:49 localhost laptop-mode: Executing: echo 3000 > /proc/sys/vm/dirty_expire_centisecs
Nov 7 10:17:49 localhost laptop-mode: Executing: echo 40 > /proc/sys/vm/dirty_ratio
Nov 7 10:17:49 localhost laptop-mode: Executing: echo 10 > /proc/sys/vm/dirty_background_ratio
Nov 7 10:17:49 localhost laptop-mode: Remounting filesystems.
Nov 7 10:17:49 localhost laptop-mode: proc not found in PARTITIONS.
Nov 7 10:17:49 localhost laptop-mode: /proc not found in PARTITIONS.
Nov 7 10:17:49 localhost laptop-mode: Checking proc against HD because PARTITIONS contains "auto".
Nov 7 10:17:49 localhost laptop-mode: Considering /dev/sda.
Nov 7 10:17:49 localhost laptop-mode: sys not found in PARTITIONS.
Nov 7 10:17:49 localhost laptop-mode: /sys not found in PARTITIONS.
Nov 7 10:17:49 localhost laptop-mode: Checking sys against HD because PARTITIONS contains "auto".
Nov 7 10:17:49 localhost laptop-mode: Considering /dev/sda.
Nov 7 10:17:49 localhost laptop-mode: udev not found in PARTITIONS.
Nov 7 10:17:49 localhost laptop-mode: /dev not found in PARTITIONS.
Nov 7 10:17:49 localhost laptop-mode: Checking udev against HD because PARTITIONS contains "auto".
Nov 7 10:17:49 localhost laptop-mode: Considering /dev/sda.
Nov 7 10:17:49 localhost laptop-mode: run not found in PARTITIONS.
Nov 7 10:17:49 localhost laptop-mode: /run not found in PARTITIONS.
Nov 7 10:17:49 localhost laptop-mode: Checking run against HD because PARTITIONS contains "auto".
Nov 7 10:17:49 localhost laptop-mode: Considering /dev/sda.
Nov 7 10:17:49 localhost laptop-mode: /dev/disk/by-uuid/eee19e9b-0c32-452e-adb3-a43880fa4f7f not found in PARTITIONS.
Nov 7 10:17:49 localhost laptop-mode: / not found in PARTITIONS.
Nov 7 10:17:49 localhost laptop-mode: Checking /dev/disk/by-uuid/eee19e9b-0c32-452e-adb3-a43880fa4f7f against HD because PARTITIONS contains "auto".
Nov 7 10:17:49 localhost laptop-mode: Considering /dev/sda.
Nov 7 10:17:49 localhost laptop-mode: devpts not found in PARTITIONS.
Nov 7 10:17:49 localhost laptop-mode: /dev/pts not found in PARTITIONS.
Nov 7 10:17:49 localhost laptop-mode: Checking devpts against HD because PARTITIONS contains "auto".
Nov 7 10:17:49 localhost laptop-mode: Considering /dev/sda.
Nov 7 10:17:49 localhost laptop-mode: shm not found in PARTITIONS.
Nov 7 10:17:49 localhost laptop-mode: /dev/shm not found in PARTITIONS.
Nov 7 10:17:49 localhost laptop-mode: Checking shm against HD because PARTITIONS contains "auto".
Nov 7 10:17:49 localhost laptop-mode: Considering /dev/sda.
Nov 7 10:17:49 localhost laptop-mode: tmpfs not found in PARTITIONS.
Nov 7 10:17:49 localhost laptop-mode: /tmp not found in PARTITIONS.
Nov 7 10:17:49 localhost laptop-mode: Checking tmpfs against HD because PARTITIONS contains "auto".
Nov 7 10:17:49 localhost laptop-mode: Considering /dev/sda.
Nov 7 10:17:49 localhost laptop-mode: /dev/sda1 not found in PARTITIONS.
Nov 7 10:17:49 localhost laptop-mode: /boot not found in PARTITIONS.
Nov 7 10:17:49 localhost laptop-mode: Checking /dev/sda1 against HD because PARTITIONS contains "auto".
Nov 7 10:17:49 localhost laptop-mode: Considering /dev/sda.
Nov 7 10:17:49 localhost laptop-mode: /dev/sda1 contains /dev/sda, which is in HD, so we will remount it.
Nov 7 10:17:49 localhost laptop-mode: Original options: rw
Nov 7 10:17:49 localhost laptop-mode: Reducing file system type.
Nov 7 10:17:49 localhost laptop-mode: No saved mount options, so apparently we never remounted this filesystem during this session.
Nov 7 10:17:49 localhost laptop-mode: Not remounting.
Nov 7 10:17:49 localhost laptop-mode: Executing: /sbin/blockdev --setfra 256 /dev/sda1
Nov 7 10:17:49 localhost laptop-mode: /dev/sda4 not found in PARTITIONS.
Nov 7 10:17:49 localhost laptop-mode: /home not found in PARTITIONS.
Nov 7 10:17:49 localhost laptop-mode: Checking /dev/sda4 against HD because PARTITIONS contains "auto".
Nov 7 10:17:49 localhost laptop-mode: Considering /dev/sda.
Nov 7 10:17:49 localhost laptop-mode: /dev/sda4 contains /dev/sda, which is in HD, so we will remount it.
Nov 7 10:17:49 localhost laptop-mode: Original options: rw,commit=0
Nov 7 10:17:49 localhost laptop-mode: Reducing file system type.
Nov 7 10:17:49 localhost laptop-mode: No saved mount options, so apparently we never remounted this filesystem during this session.
Nov 7 10:17:49 localhost laptop-mode: Not remounting.
Nov 7 10:17:49 localhost laptop-mode: Executing: /sbin/blockdev --setfra 256 /dev/sda4
Nov 7 10:17:49 localhost laptop-mode: Invoking module /usr/share/laptop-mode-tools/modules/lcd-brightness.
Nov 7 10:17:49 localhost laptop-mode: Invoking module /usr/share/laptop-mode-tools/modules/nmi-watchdog.
Nov 7 10:17:49 localhost laptop-mode: On AC power: setting NMI Watchdog Timer to 1
Nov 7 10:17:49 localhost laptop-mode: NMI Watchdog timer enabled
Nov 7 10:17:49 localhost laptop-mode: Invoking module /usr/share/laptop-mode-tools/modules/runtime-pm.
Nov 7 10:17:49 localhost laptop-mode: Activating Runtime PM for device type PCI
Nov 7 10:17:49 localhost laptop-mode: Setting Runtime PM auto for device /sys/bus/pci/devices/0000:00:00.0
Nov 7 10:17:49 localhost laptop-mode: Setting Runtime PM auto for device /sys/bus/pci/devices/0000:00:01.0
Nov 7 10:17:49 localhost laptop-mode: Setting Runtime PM auto for device /sys/bus/pci/devices/0000:00:1a.0
Nov 7 10:17:49 localhost laptop-mode: Setting Runtime PM auto for device /sys/bus/pci/devices/0000:00:1a.1
Nov 7 10:17:49 localhost laptop-mode: Setting Runtime PM auto for device /sys/bus/pci/devices/0000:00:1a.2
Nov 7 10:17:49 localhost laptop-mode: Setting Runtime PM auto for device /sys/bus/pci/devices/0000:00:1a.7
Nov 7 10:17:49 localhost laptop-mode: Setting Runtime PM auto for device /sys/bus/pci/devices/0000:00:1b.0
Nov 7 10:17:49 localhost laptop-mode: Setting Runtime PM auto for device /sys/bus/pci/devices/0000:00:1c.0
Nov 7 10:17:49 localhost laptop-mode: Setting Runtime PM auto for device /sys/bus/pci/devices/0000:00:1c.1
Nov 7 10:17:49 localhost laptop-mode: Setting Runtime PM auto for device /sys/bus/pci/devices/0000:00:1c.2
Nov 7 10:17:49 localhost laptop-mode: Setting Runtime PM auto for device /sys/bus/pci/devices/0000:00:1c.3
Nov 7 10:17:49 localhost laptop-mode: Setting Runtime PM auto for device /sys/bus/pci/devices/0000:00:1c.4
Nov 7 10:17:49 localhost laptop-mode: Setting Runtime PM auto for device /sys/bus/pci/devices/0000:00:1c.5
Nov 7 10:17:49 localhost laptop-mode: Setting Runtime PM auto for device /sys/bus/pci/devices/0000:00:1d.0
Nov 7 10:17:49 localhost laptop-mode: Setting Runtime PM auto for device /sys/bus/pci/devices/0000:00:1d.1
Nov 7 10:17:49 localhost laptop-mode: Setting Runtime PM auto for device /sys/bus/pci/devices/0000:00:1d.2
Nov 7 10:17:49 localhost laptop-mode: Setting Runtime PM auto for device /sys/bus/pci/devices/0000:00:1d.7
Nov 7 10:17:49 localhost laptop-mode: Setting Runtime PM auto for device /sys/bus/pci/devices/0000:00:1e.0
Nov 7 10:17:49 localhost laptop-mode: Setting Runtime PM auto for device /sys/bus/pci/devices/0000:00:1f.0
Nov 7 10:17:49 localhost laptop-mode: Setting Runtime PM auto for device /sys/bus/pci/devices/0000:00:1f.2
Nov 7 10:17:49 localhost laptop-mode: Setting Runtime PM auto for device /sys/bus/pci/devices/0000:00:1f.3
Nov 7 10:17:49 localhost laptop-mode: Setting Runtime PM auto for device /sys/bus/pci/devices/0000:01:00.0
Nov 7 10:17:49 localhost laptop-mode: Setting Runtime PM auto for device /sys/bus/pci/devices/0000:08:00.0
Nov 7 10:17:49 localhost laptop-mode: Setting Runtime PM auto for device /sys/bus/pci/devices/0000:0e:00.0
Nov 7 10:17:49 localhost laptop-mode: Setting Runtime PM auto for device /sys/bus/pci/devices/0000:1a:00.0
Nov 7 10:17:49 localhost laptop-mode: Setting Runtime PM auto for device /sys/bus/pci/devices/0000:1a:00.1
Nov 7 10:17:49 localhost laptop-mode: Setting Runtime PM auto for device /sys/bus/pci/devices/0000:1a:00.2
Nov 7 10:17:49 localhost laptop-mode: Activating Runtime PM for device type SPI
Nov 7 10:17:49 localhost laptop-mode: /sys/bus/spi/devices/* does not support Runtime PM
Nov 7 10:17:49 localhost laptop-mode: Activating Runtime PM for device type i2c
Nov 7 10:17:49 localhost laptop-mode: Setting Runtime PM auto for device /sys/bus/i2c/devices/i2c-0
Nov 7 10:17:49 localhost laptop-mode: Setting Runtime PM auto for device /sys/bus/i2c/devices/i2c-1
Nov 7 10:17:49 localhost laptop-mode: Setting Runtime PM auto for device /sys/bus/i2c/devices/i2c-2
Nov 7 10:17:49 localhost laptop-mode: Invoking module /usr/share/laptop-mode-tools/modules/sched-mc-power-savings.
Nov 7 10:17:49 localhost laptop-mode: On AC power: setting scheduler power saving to 0.
Nov 7 10:17:49 localhost laptop-mode: Scheduler power saving is not available.
Nov 7 10:17:49 localhost laptop-mode: Invoking module /usr/share/laptop-mode-tools/modules/sched-smt-power-savings.
Nov 7 10:17:49 localhost laptop-mode: On AC power: setting scheduler power saving to 0.
Nov 7 10:17:49 localhost laptop-mode: Scheduler SMT power saving is not available.
Nov 7 10:17:49 localhost laptop-mode: Invoking module /usr/share/laptop-mode-tools/modules/start-stop-programs.
Nov 7 10:17:49 localhost laptop-mode: START_SERVICES =
Nov 7 10:17:49 localhost laptop-mode: STOP_SERVICES =
Nov 7 10:17:49 localhost laptop-mode: Invoking module /usr/share/laptop-mode-tools/modules/syslog-conf.
Nov 7 10:17:49 localhost laptop-mode: Invoking module /usr/share/laptop-mode-tools/modules/terminal-blanking.
Nov 7 10:17:49 localhost laptop-mode: Set terminal blanking timeout to 10 min, powerdown timeout to 50 min.
Nov 7 10:17:49 localhost laptop-mode: Terminal /dev/tty1 found, adjusting.
Nov 7 10:17:49 localhost laptop-mode: Invoking module /usr/share/laptop-mode-tools/modules/usb-autosuspend.
Nov 7 10:17:49 localhost laptop-mode: Disabling autosuspend mode for USBCORE Controller, with timeout 0.
Nov 7 10:17:49 localhost laptop-mode: Not disabling auto suspend mode for usb device 1-0:1.0
Nov 7 10:17:49 localhost laptop-mode: Not enabling ON power level for usb device 1-0:1.0
Nov 7 10:17:49 localhost laptop-mode: Not disabling auto suspend mode for usb device 2-0:1.0
Nov 7 10:17:49 localhost laptop-mode: Not enabling ON power level for usb device 2-0:1.0
Nov 7 10:17:49 localhost laptop-mode: Disabling auto suspend mode for usb device 2-2.
Nov 7 10:17:49 localhost laptop-mode: Enabling ON power level for usb device 2-2.
Nov 7 10:17:49 localhost laptop-mode: Not disabling auto suspend mode for usb device 2-2:1.0
Nov 7 10:17:49 localhost laptop-mode: Not enabling ON power level for usb device 2-2:1.0
Nov 7 10:17:49 localhost laptop-mode: Not disabling auto suspend mode for usb device 2-2:1.1
Nov 7 10:17:49 localhost laptop-mode: Not enabling ON power level for usb device 2-2:1.1
Nov 7 10:17:49 localhost laptop-mode: Not disabling auto suspend mode for usb device 3-0:1.0
Nov 7 10:17:49 localhost laptop-mode: Not enabling ON power level for usb device 3-0:1.0
Nov 7 10:17:49 localhost laptop-mode: Not disabling auto suspend mode for usb device 4-0:1.0
Nov 7 10:17:49 localhost laptop-mode: Not enabling ON power level for usb device 4-0:1.0
Nov 7 10:17:49 localhost laptop-mode: Disabling auto suspend mode for usb device 4-1.
Nov 7 10:17:49 localhost laptop-mode: Enabling ON power level for usb device 4-1.
Nov 7 10:17:49 localhost laptop-mode: Not disabling auto suspend mode for usb device 4-1:1.0
Nov 7 10:17:49 localhost laptop-mode: Not enabling ON power level for usb device 4-1:1.0
Nov 7 10:17:49 localhost laptop-mode: Not disabling auto suspend mode for usb device 4-1:1.1
Nov 7 10:17:49 localhost laptop-mode: Not enabling ON power level for usb device 4-1:1.1
Nov 7 10:17:49 localhost laptop-mode: Not disabling auto suspend mode for usb device 5-0:1.0
Nov 7 10:17:49 localhost laptop-mode: Not enabling ON power level for usb device 5-0:1.0
Nov 7 10:17:49 localhost laptop-mode: Not disabling auto suspend mode for usb device 6-0:1.0
Nov 7 10:17:49 localhost laptop-mode: Not enabling ON power level for usb device 6-0:1.0
Nov 7 10:17:49 localhost laptop-mode: Not disabling auto suspend mode for usb device 7-0:1.0
Nov 7 10:17:49 localhost laptop-mode: Not enabling ON power level for usb device 7-0:1.0
Nov 7 10:17:49 localhost laptop-mode: Not disabling auto suspend mode for usb device 8-0:1.0
Nov 7 10:17:49 localhost laptop-mode: Not enabling ON power level for usb device 8-0:1.0
Nov 7 10:17:49 localhost laptop-mode: Disabling auto suspend mode for usb device 8-1.
Nov 7 10:17:49 localhost laptop-mode: Enabling ON power level for usb device 8-1.
Nov 7 10:17:49 localhost laptop-mode: Disabling auto suspend mode for usb device 8-1.1.
Nov 7 10:17:49 localhost laptop-mode: Enabling ON power level for usb device 8-1.1.
Nov 7 10:17:49 localhost laptop-mode: Not disabling auto suspend mode for usb device 8-1.1:1.0
Nov 7 10:17:49 localhost laptop-mode: Not enabling ON power level for usb device 8-1.1:1.0
Nov 7 10:17:49 localhost laptop-mode: Not disabling auto suspend mode for usb device 8-1.1:1.1
Nov 7 10:17:49 localhost laptop-mode: Not enabling ON power level for usb device 8-1.1:1.1
Nov 7 10:17:49 localhost laptop-mode: Not disabling auto suspend mode for usb device 8-1.1:1.2
Nov 7 10:17:49 localhost laptop-mode: Not enabling ON power level for usb device 8-1.1:1.2
Nov 7 10:17:49 localhost laptop-mode: Not disabling auto suspend mode for usb device 8-1.1:1.3
Nov 7 10:17:49 localhost laptop-mode: Not enabling ON power level for usb device 8-1.1:1.3
Nov 7 10:17:49 localhost laptop-mode: Disabling auto suspend mode for usb device 8-1.2.
Nov 7 10:17:49 localhost laptop-mode: Enabling ON power level for usb device 8-1.2.
Nov 7 10:17:49 localhost laptop-mode: Not disabling auto suspend mode for usb device 8-1.2:1.0
Nov 7 10:17:49 localhost laptop-mode: Not enabling ON power level for usb device 8-1.2:1.0
Nov 7 10:17:49 localhost laptop-mode: Disabling auto suspend mode for usb device 8-1.3.
Nov 7 10:17:49 localhost laptop-mode: Enabling ON power level for usb device 8-1.3.
Nov 7 10:17:49 localhost laptop-mode: Not disabling auto suspend mode for usb device 8-1.3:1.0
Nov 7 10:17:49 localhost laptop-mode: Not enabling ON power level for usb device 8-1.3:1.0
Nov 7 10:17:49 localhost laptop-mode: Not disabling auto suspend mode for usb device 8-1:1.0
Nov 7 10:17:49 localhost laptop-mode: Not enabling ON power level for usb device 8-1:1.0
Nov 7 10:17:49 localhost laptop-mode: Disabling auto suspend mode for usb device usb1.
Nov 7 10:17:49 localhost laptop-mode: Enabling ON power level for usb device usb1.
Nov 7 10:17:49 localhost laptop-mode: Disabling auto suspend mode for usb device usb2.
Nov 7 10:17:49 localhost laptop-mode: Enabling ON power level for usb device usb2.
Nov 7 10:17:49 localhost laptop-mode: Disabling auto suspend mode for usb device usb3.
Nov 7 10:17:49 localhost laptop-mode: Enabling ON power level for usb device usb3.
Nov 7 10:17:49 localhost laptop-mode: Disabling auto suspend mode for usb device usb4.
Nov 7 10:17:49 localhost laptop-mode: Enabling ON power level for usb device usb4.
Nov 7 10:17:49 localhost laptop-mode: Disabling auto suspend mode for usb device usb5.
Nov 7 10:17:49 localhost laptop-mode: Enabling ON power level for usb device usb5.
Nov 7 10:17:49 localhost laptop-mode: Disabling auto suspend mode for usb device usb6.
Nov 7 10:17:49 localhost laptop-mode: Enabling ON power level for usb device usb6.
Nov 7 10:17:49 localhost laptop-mode: Disabling auto suspend mode for usb device usb7.
Nov 7 10:17:49 localhost laptop-mode: Enabling ON power level for usb device usb7.
Nov 7 10:17:49 localhost laptop-mode: Disabling auto suspend mode for usb device usb8.
Nov 7 10:17:49 localhost laptop-mode: Enabling ON power level for usb device usb8.
Nov 7 10:17:49 localhost laptop-mode: Invoking module /usr/share/laptop-mode-tools/modules/video-out.
Nov 7 10:17:49 localhost laptop-mode: video-out module is disabled.
Nov 7 10:17:49 localhost laptop-mode: Invoking module /usr/share/laptop-mode-tools/modules/wireless-ipw-power.
Nov 7 10:17:49 localhost laptop-mode: Invoking module /usr/share/laptop-mode-tools/modules/wireless-iwl-power.
Nov 7 10:17:49 localhost laptop-mode: Setting power levels for iwlwifi wireless interfaces.
Nov 7 10:17:49 localhost laptop-mode: Invoking module /usr/share/laptop-mode-tools/modules/wireless-power.
Nov 7 10:17:49 localhost laptop-mode: Setting power saving for generic wireless interfaces.
Nov 7 10:17:49 localhost laptop-mode: On AC power: setting power saving mode for wlan0 to off.
Nov 7 10:17:49 localhost laptop-mode: Failed.
Nov 7 10:17:49 localhost laptop-mode: Module /usr/local/lib/laptop-mode-tools/modules/* is not executable or is to be skipped.
Nov 7 10:17:49 localhost laptop-mode: Module /usr/local/share/laptop-mode-tools/modules/* is not executable or is to be skipped.
Nov 7 10:17:49 localhost laptop-mode: Module /etc/laptop-mode/modules/* is not executable or is to be skipped.

Try to reproduce:
$ sudo iwconfig wlan0 power on
Error for wireless request "Set Power Management" (8B2C) :
SET failed on device wlan0 ; Operation not supported.
This may mean that power management on the wlan hardware is not supported, and we should turn it off in /etc/laptop-mode/conf.d/wireless-power.conf:
CONTROL_WIRELESS_POWER_SAVING=0
Now I don't get the error anymore, and still in hope wireless saves power automagically.
PS.
Odd is that /etc/laptop-mode/modules/ is empty as all the other dirs mentioned in 3 latter log items.

Similar Messages

  • Laptop-mode: failed - udev not active?

    I get this message when I start Arch. It usually appears twice.
    Nothing is broken as far as I know, but I'm just annoyed by it. Anyone got an idea why this error might pop up?
    Last edited by TheChosenOne (2014-02-09 01:05:53)

    This is a udev grep on journalctl:
    Feb 08 21:48:23 localhost systemd-udevd[46]: starting version 208
    Feb 08 21:48:23 localhost systemd[1]: Starting udev Kernel Socket.
    Feb 08 21:48:23 localhost systemd[1]: Listening on udev Kernel Socket.
    Feb 08 21:48:23 localhost systemd[1]: Starting udev Control Socket.
    Feb 08 21:48:23 localhost systemd[1]: Listening on udev Control Socket.
    Feb 08 21:48:23 localhost systemd[1]: Starting udev Coldplug all Devices...
    Feb 08 21:48:23 localhost systemd[1]: Started udev Coldplug all Devices.
    Feb 08 21:48:23 localhost systemd[1]: Starting udev Kernel Device Manager...
    Feb 08 21:48:23 localhost systemd[1]: Started udev Kernel Device Manager.
    Feb 08 21:48:23 localhost systemd-udevd[124]: starting version 208
    Feb 08 21:48:30 localhost systemd-udevd[144]: renamed network interface eth0 to enp2s0
    Feb 08 21:48:31 localhost systemd-udevd[143]: renamed network interface wlan0 to wlp1s0
    Feb 08 21:48:32 localhost laptop-mode[975]: failed - udev not active?
    Feb 08 21:48:33 localhost laptop-mode[1052]: failed - udev not active?

  • [SOLVED] systemd: laptop-mode-tools fails to start (No such file ...)

    Hi,
    I recently moved to systemd. I noticed that 'laptop-mode-tools' does not start:
    Loaded: error (Reason: No such file or directory)
    Active: inactive (dead)
    Also laptop-mode itself does not run (but exits successfully), maybe this has something to do with it:
    laptop-mode.service - Laptop Mode Tools
    Loaded: loaded (/usr/lib/systemd/system/laptop-mode.service; enabled)
    Active: active (exited) since Sat, 2012-11-10 10:44:13 CET; 2min 17s ago
    Process: 1020 ExecStart=/usr/sbin/laptop_mode init auto (code=exited, status=0/SUCCESS)
    CGroup: name=systemd:/system/laptop-mode.service
    I cannot find anything in journal that would help resolve this issue. Has someone else come across this problem? Where should I look to fix this issue?
    Sidenote: When I boot up, there show up some errors about 'eth0' and 'wlan0' "No such file or directory", but I cannot find them in the journal so I don't know them exactly.
    Last edited by javex (2012-11-10 12:41:07)

    When I upgraded, pacman said the following
    [2012-11-04 09:41] The systemd service name has changed from \laptop-mode-tools" to "laptop-mode"
    [2012-11-04 09:41] The change requires the old symlink to be manually removed:
    [2012-11-04 09:41] rm /etc/systemd/system/multi-user.target.wants/laptop-mode-tools.service
    [2012-11-04 09:41] The laptop-mode.service can be enabled using:
    [2012-11-04 09:41] systemctl enable laptop-mode
    [2012-11-04 09:41] upgraded laptop-mode-tools (1.61-2 -> 1.62-2)

  • Acpid vs dbus vs laptop-mode-tools - What's the relationship?

    I disabled acpid from daemons, and uninstalled it, and to my surprise, the Suspend option still appears in the XFCE4 logout window, and when I open the lid the lappy comes right back. I had been under the impression that acpid was required for actions to take place on lid open/close. After a bit more research it appears that acpid is nothing more than a daemon that watches /proc and /sys for power and laptop related events, and that any daemon can do this, and in fact, cpufrequtils is such a daemon that just has a subset of events that it watches.
    Then I noticed today that on my Arch that when I close the lid, my LCD brightness goes down, and I have to use the function keys to bring brightness back. If I don't have acpid or laptop-mode-tools installed, I assume that dbus is handling this dimming? Or the hardware BIOS?
    Why isn't dbus handling things like AC adapter plugging and unplugging, and button events? Is there any reason to use acpid at all these days?

    Confirmed that like pogeymanz, laptop-mode-tools really does nothing without acpid. I guess it will set some of the other static values for devices listed in /etc/laptop-mode/conf.d/ but that's it. Tested by setting laptop-mode-tools to change the cpu scaling governor to powersave on battery, disabling acpid and unplugging laptop, then running cpufreq-info. No change.
    Then started acpid again from the init script, plug and unplug, now governor is powersave.
    It appears that acpid is a hard dependency, and that package should really be changed to fix that. If you look at the file list, there are 6 scripts placed into /etc/acpi/events/
    etc/acpi/actions/lm_ac_adapter.sh
    etc/acpi/actions/lm_battery.sh
    etc/acpi/actions/lm_lid.sh
    etc/acpi/events/lm_ac_adapter
    etc/acpi/events/lm_battery
    etc/acpi/events/lm_lid
    So laptop-mode-tools isn't even watching the acpid socket itself (/var/run/acpid.socket), and it relies solely on acpid to tell it about AC and lid status, so any configuration that you do in laptop-mode-tools that depends on checking for normal status changes on a notebook computer will fail to change anything without acpid installed and running.

  • Laptop mode tools problem with kernel 3.0

    today I just updated the system and my laptop runs dramatically hotter after that. I read the archwiki, it does talk about the laptop mode tools problem with kernel 3.0 but when I opened the file /usr/sbin/laptop_mode, the lines which the wiki mentions are not there. Does anyone here have the same problem and can you offer the solution?
    Here is my /usr/sbin/laptop_mode
    #! /bin/sh
    # Script to start or stop laptop_mode, and to control various settings of the
    # kernel, hardware etc. that influence power consumption.
    # This script is a part of Laptop Mode Tools. If you are running a supported
    # power management daemon, this script will be automatically called on power
    # state change.
    # Configure laptop mode tools in /etc/laptop-mode/laptop-mode.conf, and in
    # the broken-out config files in /etc/laptop-mode/conf.d.
    # Please consult the manual pages laptop-mode.conf(8) and laptop_mode(8) for
    # additional information.
    # Maintainer: Ritesh Raj Sarraf ([email protected])
    # Original Author: Bart Samwel ([email protected])
    # Project home page: http://samwel.tk/laptop_mode
    # Contributors to this script: Bart Samwel
    # Kiko Piris
    # Micha Feigin
    # Andrew Morton
    # Herve Eychenne
    # Dax Kelson
    # Jan Polacek
    # ... and many others that I've stopped
    # keeping track of.
    # Based on a script for Linux 2.4 written by Jens Axboe.
    set -a
    # The laptop mode tools version number. Extracted by the installer makefile
    # as well, so don't change the format!
    LMTVERSION=1.59
    # This script is loaded from multiple scripts to set the config defaults
    # and to read the configuration on top of those. Only when the command is
    # recognized does this script do anything else.
    VERBOSE_OUTPUT=0
    ENABLE_LAPTOP_MODE_ON_BATTERY=1
    ENABLE_LAPTOP_MODE_ON_AC=0
    ENABLE_LAPTOP_MODE_WHEN_LID_CLOSED=0
    PARTITIONS="auto /dev/mapper/*"
    LM_BATT_MAX_LOST_WORK_SECONDS=600
    LM_AC_MAX_LOST_WORK_SECONDS=360
    DEF_MAX_AGE=30
    LM_READAHEAD=3072
    NOLM_READAHEAD=128
    CONTROL_READAHEAD=1
    CONTROL_NOATIME=0
    USE_RELATIME=1
    CONTROL_HD_IDLE_TIMEOUT=1
    LM_AC_HD_IDLE_TIMEOUT=4 # 20 seconds
    LM_BATT_HD_IDLE_TIMEOUT=4 # 20 seconds
    NOLM_HD_IDLE_TIMEOUT=244 # 2 hours
    DEF_UPDATE=5
    DEF_XFS_AGE_BUFFER=15
    DEF_XFS_SYNC_INTERVAL=30
    DEF_XFS_BUFD_INTERVAL=1
    XFS_HZ=100
    CONTROL_MOUNT_OPTIONS=1
    BATT_HD_POWERMGMT=1
    LM_AC_HD_POWERMGMT=254
    NOLM_AC_HD_POWERMGMT=254
    CONTROL_HD_POWERMGMT=0
    CONTROL_HD_WRITECACHE=0
    NOLM_AC_HD_WRITECACHE=1
    NOLM_BATT_HD_WRITECACHE=0
    LM_HD_WRITECACHE=0
    LM_DIRTY_RATIO=60
    LM_DIRTY_BACKGROUND_RATIO=1
    NOLM_DIRTY_BACKGROUND_RATIO=10
    NOLM_DIRTY_RATIO=40
    LM_SECONDS_BEFORE_SYNC=2
    BATT_CPU_MAXFREQ=medium
    BATT_CPU_MINFREQ=slowest
    BATT_CPU_GOVERNOR=ondemand
    BATT_CPU_IGNORE_NICE_LOAD=1
    LM_AC_CPU_MAXFREQ=fastest
    LM_AC_CPU_MINFREQ=slowest
    LM_AC_CPU_GOVERNOR=ondemand
    LM_AC_CPU_IGNORE_NICE_LOAD=1
    NOLM_AC_CPU_MAXFREQ=fastest
    NOLM_AC_CPU_MINFREQ=slowest
    NOLM_AC_CPU_GOVERNOR=ondemand
    NOLM_AC_CPU_IGNORE_NICE_LOAD=0
    CONTROL_CPU_FREQUENCY=0
    HD="/dev/[hs]d[abcdefgh]"
    CONTROL_SYSLOG_CONF=0
    LM_AC_SYSLOG_CONF=/etc/syslog-on-ac-with-lm.conf
    NOLM_AC_SYSLOG_CONF=/etc/syslog-on-ac-without-lm.conf
    BATT_SYSLOG_CONF=/etc/syslog-on-battery.conf
    SYSLOG_CONF_SIGNAL_PROGRAM=syslogd
    SYSLOG_CONF=/etc/syslog.conf
    CONTROL_DPMS_STANDBY=0
    BATT_DPMS_STANDBY=300
    LM_AC_DPMS_STANDBY=1200
    NOLM_AC_DPMS_STANDBY=1200
    CONTROL_CPU_THROTTLING=0
    BATT_CPU_THROTTLING=medium
    LM_AC_CPU_THROTTLING=minimum
    NOLM_AC_CPU_THROTTLING=minimum
    CONTROL_START_STOP=1
    CONTROL_TERMINAL=0
    TERMINALS="/dev/vc/1 /dev/vcs1"
    BATT_TERMINAL_BLANK_MINUTES=1
    BATT_TERMINAL_POWERDOWN_MINUTES=2
    LM_AC_TERMINAL_BLANK_MINUTES=10
    LM_AC_TERMINAL_POWERDOWN_MINUTES=10
    NOLM_AC_TERMINAL_BLANK_MINUTES=10
    NOLM_AC_TERMINAL_POWERDOWN_MINUTES=50
    ENABLE_AUTO_HIBERNATION=0
    HIBERNATE_COMMAND=/usr/sbin/hibernate
    AUTO_HIBERNATION_ON_CRITICAL_BATTERY_LEVEL=1
    DISABLE_LAPTOP_MODE_ON_CRITICAL_BATTERY_LEVEL=1
    AUTO_HIBERNATION_BATTERY_CHARGE_MAH=0
    AUTO_HIBERNATION_BATTERY_CHARGE_MWH=0
    MINIMUM_BATTERY_CHARGE_MAH=0
    MINIMUM_BATTERY_CHARGE_MWH=0
    ASSUME_SCSI_IS_SATA=1
    CONTROL_BRIGHTNESS=0
    BATT_BRIGHTNESS_COMMAND=false
    LM_AC_BRIGHTNESS_COMMAND=false
    NOLM_AC_BRIGHTNESS_COMMAND=false
    LOG_TO_SYSLOG=1
    DEBUG=0
    ENABLE_LAPTOP_MODE_TOOLS=1
    # Initialize the PATH Variable
    export PATH="${PATH}":/bin:/sbin:/usr/bin:/usr/sbin
    # This is a 2 phase locking approach. LMT_REQ_LOCK is the outer lock and LMT_INVOC_LOCK is the inner lock
    # We take this approach to ensure the scenario that, "At any point when an event occurs (AC/BATT), the
    # kernel can generate multiple events spanning over a couple of events. The first event is honored and
    # lmt executes. If the last event triggered at the 9th second, there is a fair chance that a good amount
    # of state change would have occured in the OS, to honor that state, we keep an outer lock (LMT_REQ_LOCK)
    # handy, so that those changes can also be applied and not forgotten.
    # Workflow:
    # Event-1 is generated and lmt executes (lmt runtime could span 5-10 seconds)
    # At seventh second, 4 events generate. But Event-1 is still running.
    # We don't want to discard all the remaining 4 events, but at least honor 1 so that we can act to the changes
    # that occured in the last 7 seconds.
    # So, Event-2 acquire LMT_REQ_LOCK and waits to acquire LMT_INVOC_LOCK (which is acquire by Event-1)
    LMT_REQ_LOCK="/var/lock/lmt-req.lock"
    LMT_INVOC_LOCK="/var/lock/lmt-invoc.lock"
    FLOCK=`which flock`
    checkint ()
    # $1 arg should be the string/integer
    # that you want to check for as an integer.
    echo $1 | grep "[^0-9]" > /dev/null 2>&1
    return $?;
    # Returns 1 if it is an integer
    # Function to handle logging
    LOGGER=`which logger`;
    log ()
    # $1 should be msg type
    # $2 should be the real msg
    if [ x$LOG_TO_SYSLOG = x1 ]; then
    # NOTE: Add the check on $2 being empty, once you are confident
    # that there aren't any bugs in logging. And no bugs in executing
    # modules and logging
    if [ -x $LOGGER -a "$1" != "STATUS" ]; then
    #if [ -z $2 ]; then
    # continue
    #elif [ "$1" = "MSG" ]; then
    if [ "$1" = "MSG" ]; then
    logger -p daemon.info -t laptop-mode "$2";
    elif [ "$1" = "ERR" ]; then
    logger -p daemon.err -t laptop-mode "$2";
    elif [ "$1" = "VERBOSE" ]; then
    if [ x$VERBOSE_OUTPUT = x1 ]; then
    logger -p daemon.debug -t laptop-mode "$2";
    fi
    else
    logger -p daemon.notice -t laptop-mode "$2";
    fi
    fi
    fi
    if [ "$1" = "VERBOSE" ]; then
    $LM_VERBOSE && echo "$2" >/dev/fd/2;
    elif [ "$1" = "ERR" ]; then
    echo "$2" >/dev/fd/2;
    else
    # Message of type MSG and STATUS can go to stdout.
    echo "$2" >/dev/fd/1;
    fi
    enableDebug ()
    # Check if debug is enabled
    if [ x$(($(basename $1 | cut -d . -f1 | tr "[:lower:]" "[:upper:]" | sed 's/-/_/g')_DEBUG)) = x1 ]; then
    set -vx
    fi
    disableDebug ()
    # Check if debug is enabled
    if [ x$(($(basename $1 | cut -d . -f1 | tr "[:lower:]" "[:upper:]" | sed 's/-/_/g')_DEBUG)) = x1 ]; then
    set +vx
    fi
    # No default on these ones -- we need to detect if they have been set, for
    # backward compatibility with MINIMUM_BATTERY_MINUTES etc.
    AUTO_HIBERNATION_BATTERY_CHARGE_PERCENT=
    MINIMUM_BATTERY_CHARGE_PERCENT=
    # Backward compatibility variable that is sometimes
    # set externally (Debian init system)
    unset VERBOSE
    lmt_load_config ()
    # Source config. Some config settings have been moved from the main config file
    # to modular configuration files, and to support existing laptop-mode.conf
    # files from earlier versions, we source the modular configuration files FIRST.
    if [ -d /etc/laptop-mode/conf.d ] ; then
    for CONF in /etc/laptop-mode/conf.d/*.conf ; do
    if [ -r "$CONF" ] ; then
    . "$CONF"
    #Handle individual module debug settings
    if [ "$DEBUG" -eq 1 ]; then
    export $(basename $CONF | cut -d . -f1 | tr "[:lower:]" "[:upper:]" | sed 's/-/_/g')_DEBUG=1
    log "VERBOSE" "Enabling debug mode for module $CONF"
    fi
    DEBUG=0
    else
    log "MSG" "Warning: Configuration file $CONF is not readable, skipping."
    fi
    done
    fi
    if [ -r /etc/laptop-mode/laptop-mode.conf ] ; then
    . /etc/laptop-mode/laptop-mode.conf
    else
    log "ERR" "$0: Configuration file /etc/laptop-mode/laptop-mode.conf not present or not readable."
    exit 1
    fi
    if [ x$ENABLE_LAPTOP_MODE_TOOLS = x0 ]; then
    log "MSG" "laptop-mode-tools is disabled in config file. Exiting"
    exit 0;
    fi
    # Add a simple bash debug mode switch
    if [ "$DEBUG" -eq 1 ]; then
    set -vx;
    fi
    # Support for old config settings
    if [ "$AC_HD" != "" ] ; then
    AC_HD_WITHOUT_LM="$AC_HD"
    AC_HD_WITH_LM="$AC_HD"
    fi
    if [ "$VERBOSE" != "" ] ; then
    VERBOSE_OUTPUT="$VERBOSE"
    fi
    if [ "$CPU_MAXFREQ" != "" ] ; then
    BATT_CPU_MAXFREQ="$CPU_MAXFREQ"
    fi
    if [ "$MAX_AGE" != "" ] ; then
    LM_BATT_MAX_LOST_WORK_SECONDS="$MAX_AGE"
    LM_AC_MAX_LOST_WORK_SECONDS="$MAX_AGE"
    fi
    if [ "$DEF_AGE" != "" ] ; then
    DEF_MAX_AGE="$DEF_AGE"
    fi
    if [ "$LAPTOP_MODE_ALWAYS_ON" != "" ] ; then
    ENABLE_LAPTOP_MODE_ALWAYS="$LAPTOP_MODE_ALWAYS_ON"
    fi
    if [ "$LM_WHEN_LID_CLOSED" != "" ] ; then
    ENABLE_LAPTOP_MODE_WHEN_LID_CLOSED="$LM_WHEN_LID_CLOSED"
    fi
    if [ "$REMOUNT_PARTITIONS" != "" ] ; then
    PARTITIONS="$REMOUNT_PARTITIONS"
    fi
    if [ "$READAHEAD" != "" ] ; then
    LM_READAHEAD="$READAHEAD"
    fi
    if [ "$DO_REMOUNT_NOATIME" != "" ] ; then
    CONTROL_NOATIME="$DO_REMOUNT_NOATIME"
    fi
    if [ "$DO_HD" != "" ] ; then
    CONTROL_HD_IDLE_TIMEOUT="$DO_HD"
    fi
    if [ "$AC_HD_WITH_LM" != "" ] ; then
    LM_AC_HD_IDLE_TIMEOUT="$AC_HD_WITH_LM"
    fi
    if [ "$AC_HD_WITHOUT_LM" != "" ] ; then
    NOLM_HD_IDLE_TIMEOUT="$AC_HD_WITHOUT_LM"
    fi
    if [ "$BATT_HD" != "" ] ; then
    LM_BATT_HD_IDLE_TIMEOUT="$BATT_HD"
    fi
    if [ "$DO_REMOUNTS" != "" ] ; then
    CONTROL_MOUNT_OPTIONS="$DO_REMOUNTS"
    fi
    if [ "$DO_HD_POWERMGMT" != "" ] ; then
    CONTROL_HD_POWERMGMT="$DO_HD_POWERMGMT"
    fi
    if [ "$AC_HDPARM_POWERMGMT_WITH_LM" != "" ] ; then
    LM_AC_HD_POWERMGMT="$AC_HDPARM_POWERMGMT_WITH_LM"
    fi
    if [ "$AC_HDPARM_POWERMGMT_WITHOUT_LM" != "" ] ; then
    NOLM_AC_HD_POWERMGMT="$AC_HDPARM_POWERMGMT_WITHOUT_LM"
    fi
    if [ "$BATT_HDPARM_POWERMGMT" != "" ] ; then
    BATT_HD_POWERMGMT="$BATT_HDPARM_POWERMGMT"
    fi
    if [ "$DO_WRITECACHE" != "" ] ; then
    CONTROL_HD_WRITECACHE="$DO_WRITECACHE"
    fi
    if [ "$AC_WRITECACHE_WITHOUT_LM" != "" ] ; then
    NOLM_AC_HD_WRITECACHE="$AC_WRITECACHE_WITHOUT_LM"
    fi
    if [ "$BATT_WRITECACHE" != "" ] ; then
    LM_HD_WRITECACHE="$BATT_WRITECACHE"
    fi
    if [ "$DIRTY_RATIO" != "" ]; then
    LM_DIRTY_RATIO="$DIRTY_RATIO"
    fi
    if [ "$DIRTY_BACKGROUND_RATIO" != "" ] ; then
    LM_DIRTY_BACKGROUND_RATIO="$DIRTY_BACKGROUND_RATIO"
    fi
    if [ "$DEF_DIRTY_RATIO" != "" ]; then
    NOLM_DIRTY_RATIO="$DEF_DIRTY_RATIO"
    fi
    if [ "$DEF_DIRTY_BACKGROUND_RATIO" != "" ] ; then
    NOLM_DIRTY_BACKGROUND_RATIO="$DEF_DIRTY_BACKGROUND_RATIO"
    fi
    if [ "$DO_CPU" != "" ] ; then
    CONTROL_CPU_FREQUENCY="$DO_CPU"
    fi
    if [ "$CONTROL_CPU_MAXFREQ" != "" ] ; then
    CONTROL_CPU_FREQUENCY="$CONTROL_CPU_MAXFREQ"
    fi
    if [ "$AC_CPU_MAXFREQ_WITH_LM" != "" ] ; then
    LM_AC_CPU_MAXFREQ="$AC_CPU_MAXFREQ_WITH_LM"
    fi
    if [ "$AC_CPU_MAXFREQ_WITHOUT_LM" != "" ] ; then
    NOLM_AC_CPU_MAXFREQ="$AC_CPU_MAXFREQ_WITHOUT_LM"
    fi
    if [ "$DO_SYSLOG" != "" ] ; then
    CONTROL_SYSLOG_CONF="$DO_SYSLOG"
    fi
    if [ "$SYSLOG_SIGNAL_PROGRAM" != "" ] ;then
    SYSLOG_CONF_SIGNAL_PROGRAM="$SYSLOG_SIGNAL_PROGRAM"
    fi
    if [ "$AC_SYSLOG_WITH_LM" != "" ] ; then
    LM_AC_SYSLOG_CONF="$AC_SYSLOG_WITH_LM"
    fi
    if [ "$AC_SYSLOG_WITHOUT_LM" != "" ] ; then
    NOLM_AC_SYSLOG_CONF="$AC_SYSLOG_WITHOUT_LM"
    fi
    if [ "$BATT_SYSLOG" != "" ] ; then
    BATT_SYSLOG_CONF="$BATT_SYSLOG"
    fi
    if [ "$ENABLE_LAPTOP_MODE_ALWAYS" != "" ] ; then
    ENABLE_LAPTOP_MODE_ON_AC="$ENABLE_LAPTOP_MODE_ALWAYS"
    fi
    if [ "$MINIMUM_BATTERY_MINUTES" != "" -a "$MINIMUM_BATTERY_CHARGE_PERCENT" = "" ] ; then
    # Use a very conservative estimate (1% = 1 battery minute, 100 minutes in a battery)
    # for backward compatibility.
    MINIMUM_BATTERY_CHARGE_PERCENT="$MINIMUM_BATTERY_MINUTES"
    fi
    if [ -z "$MINIMUM_BATTERY_CHARGE_PERCENT" ] ; then
    # Apply the default, now that we've determined that this is the minimum.
    MINIMUM_BATTERY_CHARGE_PERCENT=3
    fi
    if [ "$AUTO_HIBERNATION_BATTERY_MINUTES" != "" -a "$AUTO_HIBERNATION_BATTERY_CHARGE_PERCENT" = "" ] ; then
    # Use a very conservative estimate (1% = 1 battery minute, 100 minutes in a battery)
    # for backward compatibility.
    AUTO_HIBERNATION_BATTERY_CHARGE_PERCENT="$AUTO_HIBERNATION_BATTERY_MINUTES"
    fi
    if [ -z "$AUTO_HIBERNATION_BATTERY_CHARGE_PERCENT" ] ; then
    # Apply the default, now that we've determined that this is the minimum.
    AUTO_HIBERNATION_BATTERY_CHARGE_PERCENT=2
    fi
    # Postprocessing
    if [ "$VERBOSE_OUTPUT" -ne 0 ] ; then
    OUTPUT="/dev/stdout"
    LM_VERBOSE="[ 1 = 1 ]"
    else
    OUTPUT="/dev/null"
    LM_VERBOSE="[ 1 = 0 ]"
    fi
    if [ "$PARTITIONS" = "" ] ; then
    PARTITIONS="auto /dev/mapper/*"
    fi
    # Expand shell wild cards immediately.
    PARTITIONS=$( echo $PARTITIONS )
    TERMINALS=$( echo $TERMINALS )
    # Convert seconds to hdparm -S format
    # Everything over 20 minutes is interpreted as 2 hours.
    seconds_to_hdparm_S() {
    if [ "$1" -eq 0 ] ; then
    # disable.
    echo 0
    elif [ "$1" -gt 0 -a "$1" -lt 5 ] ; then
    # 5 seconds minimum
    echo 1
    elif [ "$1" -le $((240*5)) ] ; then
    # Values between 1 and 240 signify increments of 5 seconds
    echo $(($1 / 5))
    elif [ "$1" -lt $((30*60)) ] ; then
    # Values between 20 and 30 minutes are rounded up to 30 minutes.
    echo 241
    elif [ "$1" -lt $((12*30*60)) ] ; then
    # Values between 30 minutes and 6 hours (exclusive) yield values between
    # 241 and 251, in 30-minute increments.
    echo $(( 240 + ($1 / (30*60)) ))
    else
    # Larger values effectively indicate no timeout at all.
    echo 0
    fi
    # Convert configured idle timeouts to hdparm -S format.
    if [ "$LM_AC_HD_IDLE_TIMEOUT_SECONDS" != "" ] ; then
    LM_AC_HD_IDLE_TIMEOUT=$(seconds_to_hdparm_S $LM_AC_HD_IDLE_TIMEOUT_SECONDS)
    fi
    if [ "$LM_BATT_HD_IDLE_TIMEOUT_SECONDS" != "" ] ; then
    LM_BATT_HD_IDLE_TIMEOUT=$(seconds_to_hdparm_S $LM_BATT_HD_IDLE_TIMEOUT_SECONDS)
    fi
    if [ "$NOLM_HD_IDLE_TIMEOUT_SECONDS" != "" ] ; then
    NOLM_HD_IDLE_TIMEOUT=$(seconds_to_hdparm_S $NOLM_HD_IDLE_TIMEOUT_SECONDS)
    fi
    # The main workhorse.
    lmt_main_function ()
    if [ "$1" = "status" ] ; then
    # Display a status report.
    log "STATUS" "Mounts:"
    mount | sed "s/^/ /"
    log "STATUS" " "
    log "STATUS" "Drive power status:"
    for disk in $HD; do
    if [ -r $disk ]; then
    hdparm -C $disk 2>/dev/null | sed "s/^/ /"
    else
    log "STATUS" " Cannot read $disk, permission denied - $0 needs to be run as root"
    fi
    done
    log "STATUS" " "
    log "STATUS" "(NOTE: drive settings affected by Laptop Mode cannot be retrieved.)"
    log "STATUS" " "
    log "STATUS" "Readahead states:"
    cat /etc/mtab | while read DEV MP FST OPTS DUMP PASS ; do
    # skip funny stuff
    case "$FST" in
    rootfs|unionfs|tmpfs|squashfs|sysfs|usbfs|proc|devpts) continue
    esac
    if [ -b $DEV ] ; then
    if [ -r $DEV ] ; then
    log "STATUS" " $DEV: $((`blockdev --getra $DEV` / 2)) kB"
    else
    log "STATUS" " Cannot read $DEV, permission denied - $0 needs to be run as root"
    fi
    fi
    done
    log "STATUS" " "
    if [ -e /var/run/laptop-mode-tools/enabled ] ; then
    log "STATUS" "Laptop Mode Tools is allowed to run: /var/run/laptop-mode-tools/enabled exists."
    else
    log "STATUS" "Laptop Mode Tools is NOT allowed to run: /var/run/laptop-mode-tools/enabled does not exist."
    fi
    log "STATUS" " "
    STATFILES="/proc/sys/vm/laptop_mode /proc/apm /proc/pmu/info /proc/sys/vm/bdflush /proc/sys/vm/dirty_ratio /proc/sys/fs/xfs/age_buffer /proc/sys/fs/xfs/sync_interval /proc/sys/fs/xfs/lm_age_buffer /proc/sys/fs/xfs/lm_sync_interval /proc/sys/vm/pagebuf/lm_flush_age /proc/sys/fs/xfs/xfsbufd_centisecs /proc/sys/fs/xfs/xfssyncd_centisecs /proc/sys/vm/dirty_background_ratio /proc/sys/vm/dirty_expire_centisecs /proc/sys/fs/xfs/age_buffer/centisecs /proc/sys/vm/dirty_writeback_centisecs /sys/devices/system/cpu/*/cpufreq/cpuinfo_*_freq /sys/devices/system/cpu/*/cpufreq/scaling_governor /proc/acpi/button/lid/*/state /proc/acpi/ac_adapter/*/state /proc/acpi/battery/*/state /sys/class/power_supply/*/online /sys/class/power_supply/*/state"
    for THISFILE in $STATFILES ; do
    if [ -e "$THISFILE" ] ; then
    log "STATUS" "$THISFILE:"
    if [ -r "$THISFILE" ] ; then
    cat "$THISFILE" | sed "s/^/ /"
    else
    log "STATUS" " Not accessible, permission denied - $0 needs to be run as root."
    fi
    log "STATUS" " "
    fi
    done
    elif [ "$1" != "readconfig" -a "$1" != "defaults" ] ; then
    KLEVEL="$(uname -r |
    IFS='.-' read a b c
    echo $a.$b
    KMINOR="$(uname -r |
    IFS='.-' read a b c d
    # Strip any stuff from the end -- only the initial digits are part of the KMINOR.
    echo $c | sed -e 's/\([[:digit:]]*\).*/\1/'
    # Stop exporting everything -- what we do from here is private.
    set +a
    if [ "$1" = "--version" ] ; then
    log "MSG" "Laptop Mode Tools $LMTVERSION"
    exit 0
    fi
    if [ ! -e /proc/sys/vm/laptop_mode ] ; then
    log "ERR" "Kernel does not have support for laptop mode. Please apply the laptop mode"
    log "ERR" "patch or install a newer kernel."
    exit 1
    fi
    if [ ! -w /proc/sys/vm/laptop_mode ] ; then
    log "ERR" "You do not have enough privileges to enable laptop_mode."
    exit 1
    fi
    INIT=0 # Display info in init script format?
    FORCE=0 # Force reapplying the current state?
    while [ "$1" != "" ] ; do
    case "$1" in
    init) INIT=1 ;;
    force) FORCE=1 ;;
    # Old options. We always do "auto" for any option now, but
    # we still have to accept the options.
    start) ;;
    stop) ;;
    auto) ;;
    modules=*)
    MODULES=$1
    MODULES=${MODULES#"modules="}
    devices=*)
    DEVICES=$1
    DEVICES=${DEVICES#"devices="}
    *) log "ERR" "Unrecognized option $1."
    exit 1 ;;
    esac
    shift
    done
    mkdir -p /var/run/laptop-mode-tools
    # Used to display laptop mode state later on. This is the enabled/disabled
    # state for laptop mode processing, it tells us nothing about whether laptop
    # mode is actually _active_.
    STATE=enabled
    if [ "$ENABLE_LAPTOP_MODE_ON_BATTERY" -eq 0 -a "$ENABLE_LAPTOP_MODE_ON_AC" -eq 0 -a "$ENABLE_LAPTOP_MODE_WHEN_LID_CLOSED" -eq 0 ] ; then
    STATE=disabled
    fi
    # Determine the power state.
    # First try /sys/class/power_supply/*
    FOUND_SYS_CLASS_POWER_SUPPLY_AC=0
    ON_AC=0
    for POWER_SUPPLY in /sys/class/power_supply/* ; do
    if [ -f $POWER_SUPPLY/type ] ; then
    if [ "$(cat $POWER_SUPPLY/type)" = "Mains" ] ;then
    log "VERBOSE" "Determining power state from $POWER_SUPPLY/online."
    FOUND_SYS_CLASS_POWER_SUPPLY_AC=1
    if [ "$(cat $POWER_SUPPLY/online)" = 1 ] ; then
    ON_AC=1
    fi
    fi
    fi
    done
    if [ $FOUND_SYS_CLASS_POWER_SUPPLY_AC = 1 ] ; then
    # Already found it!
    log "VERBOSE" "Not trying other options, already found a power supply."
    elif [ -d /proc/acpi/ac_adapter ] ; then
    log "VERBOSE" "Determining power state from /proc/acpi/ac_adapter."
    ADAPTERS_FOUND=0
    ON_AC=0
    for ADAPTER in /proc/acpi/ac_adapter/* ; do
    if [ -f $ADAPTER/state ] ; then
    ADAPTERS_FOUND=1
    STATUS=`awk '/^state: / { print $2 }' $ADAPTER/state`
    if [ "$STATUS" = "on-line" ] ; then
    ON_AC=1
    fi
    fi
    done
    if [ "$ADAPTERS_FOUND" -eq 0 ] ; then
    ON_AC=1
    fi
    elif [ -f /proc/pmu/info ] ; then
    log "VERBOSE" "Determining power state from /proc/pmu/info."
    if ( grep -q "^AC Power.*0$" /proc/pmu/info ) ; then
    log "VERBOSE" "/proc/pmu/info indicates absence of AC power."
    ON_AC=0
    else
    # It is possible that there is no AC Power = 1 in the file,
    # but we always assume AC power when we're not sure.
    ON_AC=1
    log "VERBOSE" "/proc/pmu/info indicates presence of AC power."
    fi
    elif [ -f /proc/apm ] ; then
    log "VERBOSE" "Determining power state from /proc/apm."
    read D1 D2 D3 APM_AC_STATE D0 </proc/apm
    if [ "$APM_AC_STATE" = "0x00" ] ; then
    ON_AC=0
    else
    ON_AC=1
    fi
    else
    log "VERBOSE" "No /sys/class/power_supply, ACPI, APM or PMU power management information found -- assuming AC power is present."
    ON_AC=1
    fi
    # Determine whether to activate or deactivate laptop mode.
    ACTIVATE=0
    if [ "$ON_AC" -eq 1 ] ; then
    if [ "$ENABLE_LAPTOP_MODE_ON_AC" -ne 0 ] ; then
    log "VERBOSE" "On AC power: Activating, because ENABLE_LAPTOP_MODE_ON_AC is set."
    ACTIVATE=1
    else
    log "VERBOSE" "On AC power: Deactivating, because ENABLE_LAPTOP_MODE_ON_AC is not set."
    ACTIVATE=0
    fi
    else
    if [ "$ENABLE_LAPTOP_MODE_ON_BATTERY" -ne 0 ] ; then
    log "VERBOSE" "On battery power: Activating, because ENABLE_LAPTOP_MODE_ON_BATTERY is set."
    ACTIVATE=1
    else
    log "VERBOSE" "On battery power: Deactivating, because ENABLE_LAPTOP_MODE_ON_BATTERY is not set."
    ACTIVATE=0
    fi
    fi
    if [ "$ENABLE_LAPTOP_MODE_WHEN_LID_CLOSED" -ne 0 -a "$ACTIVATE" -eq 0 ] ; then
    if [ -x "`which hal-find-by-property`" ] ; then
    HAL_LID_BUTTON=$(hal-find-by-property --key "button.type" --string "lid")
    fi
    if [ "$HAL_LID_BUTTON" != "" ] ; then
    HAL_LID_BUTTON_STATE=$(hal-get-property --udi $(hal-find-by-property --key "button.type" --string "lid") --key "button.state.value")
    if [ "$HAL_LID_BUTTON_STATE" = "true" ] ; then
    log "VERBOSE" "Setting action to \"start\" because the lid is closed (says HAL)."
    ACTIVATE=1
    fi
    elif [ -f /proc/acpi/button/lid/*/state ] ; then
    if ( grep -q "closed" /proc/acpi/button/lid/*/state ) ; then
    log "VERBOSE" 'Setting action to "start" because the lid is closed (says /proc/acpi/button/lid/*/state).'
    ACTIVATE=1
    fi
    else
    log "MSG" "Warning: ENABLE_LAPTOP_MODE_WHEN_LID_CLOSED is set, but there is no file"
    log "MSG" "/proc/acpi/button/lid/.../state, and hal information is not available either!"
    fi
    fi
    # If the init script has not been run or has been run with the "stop"
    # argument, then we should never start laptop mode.
    if [ ! -f /var/run/laptop-mode-tools/enabled ] ; then
    log "VERBOSE" "Laptop mode disabled because /var/run/laptop-mode-tools/enabled is missing."
    STATE=disabled
    fi
    if [ "$ACTIVATE" -eq 1 -a -f /etc/default/laptop-mode ] ; then
    . /etc/default/laptop-mode
    if ! ( echo "$ENABLE_LAPTOP_MODE" |grep y ) ; then
    log "VERBOSE" "Not starting laptop mode because it is disabled in /etc/default/laptop-mode."
    STATE=disabled
    fi
    fi
    if [ "$STATE" = "disabled" ] ; then
    ACTIVATE=0
    fi
    # Check whether we are allowed to activate the data-loss-sensitive stuff.
    # If the battery charge is too low, we want to disable this, but not the
    # other power-saving stuff.
    if [ "$ACTIVATE" -eq 0 ] ; then
    ACTIVATE_WITH_POSSIBLE_DATA_LOSS=0
    elif [ "$ON_AC" = 1 ] ; then
    log "VERBOSE" "On AC, not checking minimum battery charge."
    ACTIVATE_WITH_POSSIBLE_DATA_LOSS=1
    else
    ACTIVATE_WITH_POSSIBLE_DATA_LOSS=1
    ENOUGH_CHARGE=0
    ENOUGH_CHARGE_TO_PREVENT_HIBERNATION=0
    # Weird way of checking that /sys/class/power_supply is not empty -- but it works.
    if [ "$(echo /sys/class/power_supply/*)" != '/sys/class/power_supply/*' ] ; then
    log "VERBOSE" "Not on AC and we have battery information in /sys/class/power_supply/BAT* -- checking minimum battery charge."
    for BATT in /sys/class/power_supply/* ; do
    BATT_TYPE=$(cat $BATT/type)
    log "VERBOSE" "$BATT is of type $BATT_TYPE."
    if [ "$BATT_TYPE" != "Battery" ] ; then
    log "VERBOSE" "Not of type \"Battery\", skipping."
    else
    PREV_ENOUGH_CHARGE=$ENOUGH_CHARGE
    PREV_ENOUGH_CHARGE_TO_PREVENT_HIBERNATION=$ENOUGH_CHARGE_TO_PREVENT_HIBERNATION
    log "VERBOSE" "Checking levels for $BATT."
    PRESENT=$(cat $BATT/present)
    log "VERBOSE" "Present: $PRESENT."
    # Only do if the battery is present
    if [ "$PRESENT" -eq 1 ] ; then
    FOUND_AN_ENABLED_CHECK=0
    FOUND_AN_ENABLED_HIBERNATION_CHECK=0
    # Get the remaining capacity.
    IN_UAH=0
    IN_UWH=0
    if [ -f $BATT/charge_now ] ; then
    REMAINING=$(cat $BATT/charge_now)
    IN_UAH=1 # charge_* is in microAmpere-hours
    elif [ -f $BATT/energy_now ] ; then
    REMAINING=$(cat $BATT/energy_now)
    IN_UWH=1 # energy_* is in microWatt-hours
    else
    REMAINING=0
    fi
    if [ -z "$REMAINING" -o "$REMAINING" -eq 0 ] ; then
    log "VERBOSE" "Battery does not report remaining charge. Perhaps it is not present?"
    REMAINING=0
    fi
    log "VERBOSE" "Remaining charge: $REMAINING"
    if [ -f $BATT/charge_full_design ] ; then
    CAPACITY=$(cat $BATT/charge_full_design)
    elif [ -f $BATT/energy_full_design ] ; then
    CAPACITY=$(cat $BATT/energy_full_design)
    else
    CAPACITY=0
    fi
    if [ -z "$CAPACITY" -o "$CAPACITY" -eq 0 ] ; then
    log "VERBOSE" "Battery does not report design full charge, using non-design full charge."
    if [ -f $BATT/charge_full ] ; then
    CAPACITY=$(cat $BATT/charge_full)
    elif [ -f $BATT/energy_full_design ] ; then
    CAPACITY=$(cat $BATT/energy_full)
    else
    CAPACITY=0
    fi
    if [ -z "$CAPACITY" -o "$CAPACITY" -eq 0 ] ; then
    log "VERBOSE" "Battery does not report non-design full charge."
    CAPACITY=0
    fi
    fi
    log "VERBOSE" "Full capacity: $CAPACITY"
    # Check the charge percentage
    if [ "$MINIMUM_BATTERY_CHARGE_PERCENT" -ne 0 ] ; then
    FOUND_AN_ENABLED_CHECK=1
    if [ "$CAPACITY" -eq 0 ] ; then
    log "MSG" "WARNING: Battery does not report a capacity. Minimum battery"
    log "MSG" "charge checking does not work without a design capacity."
    ENOUGH_CHARGE=1
    elif [ "$(($REMAINING * 100 / $CAPACITY))" -ge "$MINIMUM_BATTERY_CHARGE_PERCENT" ] ; then
    ENOUGH_CHARGE=1
    fi
    fi
    if [ "$AUTO_HIBERNATION_BATTERY_CHARGE_PERCENT" -ne 0 ] ; then
    FOUND_AN_ENABLED_HIBERNATION_CHECK=1
    if [ "$CAPACITY" -eq 0 ] ; then
    log "MSG" "WARNING: Battery does not report a design capacity. Auto hibernation"
    log "MSG" "does not work without a design capacity."
    ENOUGH_CHARGE=1
    elif [ "$(($REMAINING * 100 / $CAPACITY))" -ge "$AUTO_HIBERNATION_BATTERY_CHARGE_PERCENT" ] ; then
    ENOUGH_CHARGE_TO_PREVENT_HIBERNATION=1
    fi
    fi
    # $BATT/alarm is the design_capacity_warning of a battery.
    ALARM_LEVEL=$(cat $BATT/alarm)
    if [ "$ALARM_LEVEL" -ne 0 ] ; then
    if [ "$REMAINING" -le "$ALARM_LEVEL" ] ; then
    # Restore the state we had before checking this battery, so that
    # this battery does not count as having enough charge.
    ENOUGH_CHARGE=$PREV_ENOUGH_CHARGE
    elif [ "$FOUND_AN_ENABLED_CHECK" -eq 0 ] ; then
    # This is the only check that is enabled. In that case a non-critical
    # battery level counts as "enough". (If we would count non-critical
    # battery levels as enough *always*, then the other settings would
    # have no effect; this is only a final fallback.)
    ENOUGH_CHARGE=1
    fi
    fi
    if [ "$AUTO_HIBERNATION_ON_CRITICAL_BATTERY_LEVEL" -ne 0 ] ; then
    if [ "$REMAINING" -le "$ALARM_LEVEL" ] ; then
    ENOUGH_CHARGE_TO_PREVENT_HIBERNATION=$PREV_ENOUGH_CHARGE_TO_PREVENT_HIBERNATION
    elif [ "$FOUND_AN_ENABLED_HIBERNATION_CHECK" -eq 0 ] ; then
    ENOUGH_CHARGE_TO_PREVENT_HIBERNATION=1
    fi
    fi
    # Fallback: hard values
    if [ "$IN_UAH" -ne 0 ] ; then
    if [ "$MINIMUM_BATTERY_CHARGE_MAH" -ne 0 ] ; then
    FOUND_AN_ENABLED_CHECK=1
    if [ "$REMAINING" -ge $((1000*"$MINIMUM_BATTERY_CHARGE_MAH")) ] ; then
    ENOUGH_CHARGE=1
    fi
    fi
    if [ "$AUTO_HIBERNATION_BATTERY_CHARGE_MAH" -ne 0 ] ; then
    FOUND_AN_ENABLED_HIBERNATION_CHECK=1
    if [ "$REMAINING" -ge $((1000*"$AUTO_HIBERNATION_BATTERY_CHARGE_MAH")) ] ; then
    ENOUGH_CHARGE_TO_PREVENT_HIBERNATION=1
    fi
    fi
    elif [ "$IN_UWH" -ne 0 ] ; then
    if [ "$MINIMUM_BATTERY_CHARGE_MWH" -ne 0 ] ; then
    FOUND_AN_ENABLED_CHECK=1
    if [ "$REMAINING" -ge $((1000*"$MINIMUM_BATTERY_CHARGE_MWH")) ] ; then
    ENOUGH_CHARGE=1
    fi
    fi
    if [ "$AUTO_HIBERNATION_BATTERY_CHARGE_MWH" -ne 0 ] ; then
    FOUND_AN_ENABLED_HIBERNATION_CHECK=1
    if [ "$REMAINING" -ge $((1000*"$AUTO_HIBERNATION_BATTERY_CHARGE_MWH")) ] ; then
    ENOUGH_CHARGE_TO_PREVENT_HIBERNATION=1
    fi
    fi
    else
    log "ERR" "Failed to determine battery charge. Battery charge units are not in"
    log "ERR" "mWh, uWh, mAh or uAh."
    fi
    else
    log "VERBOSE" "Battery is not present."
    fi
    fi
    done
    elif [ "$(echo /proc/acpi/battery/*)" != '/proc/acpi/battery/*' ] ; then
    log "VERBOSE" "Not on AC and we have batteries in /proc/acpi/battery -- checking minimum battery charge."
    for BATT in /proc/acpi/battery/* ; do
    PREV_ENOUGH_CHARGE=$ENOUGH_CHARGE
    PREV_ENOUGH_CHARGE_TO_PREVENT_HIBERNATION=$ENOUGH_CHARGE_TO_PREVENT_HIBERNATION
    BATT_STATE=$BATT/state
    BATT_INFO=$BATT/info
    log "VERBOSE" "Checking info and state for $BATT."
    # Only do if the battery is present
    if ( grep -q 'present:.*yes' $BATT_INFO ) ; then
    FOUND_AN_ENABLED_CHECK=0
    FOUND_AN_ENABLED_HIBERNATION_CHECK=0
    # Get the remaining capacity.
    REMAINING=`grep "remaining capacity:" $BATT_STATE | sed "s/.* \([0-9][0-9]* \).*/\1/" `
    if [ -z "$REMAINING" ] ; then
    log "VERBOSE" "Battery does not report remaining charte. Perhaps it is not present?"
    REMAINING=0
    fi
    log "VERBOSE" "Remaining charge: $REMAINING"
    CAPACITY=`grep "design capacity:" $BATT_INFO | sed "s/.* \([0-9][0-9]* \).*/\1/" `
    if [ -z "$CAPACITY" ] ; then
    log "VERBOSE" "Battery does not report capacity. Perhaps it is not present?"
    CAPACITY=0
    fi
    log "VERBOSE" "Design capacity: $CAPACITY"
    # Check the charge percentage
    if [ "$MINIMUM_BATTERY_CHARGE_PERCENT" -ne 0 ] ; then
    FOUND_AN_ENABLED_CHECK=1
    if [ "$CAPACITY" -eq 0 ] ; then
    log "MSG" "WARNING: Battery does not report a design capacity. Minimum battery"
    log "MSG" "charge checking does not work without a design capacity."
    ENOUGH_CHARGE=1
    elif [ "$(($REMAINING * 100 / $CAPACITY))" -ge "$MINIMUM_BATTERY_CHARGE_PERCENT" ] ; then
    ENOUGH_CHARGE=1
    fi
    fi
    if [ "$AUTO_HIBERNATION_BATTERY_CHARGE_PERCENT" -ne 0 ] ; then
    FOUND_AN_ENABLED_HIBERNATION_CHECK=1
    if [ "$CAPACITY" -eq 0 ] ; then
    log "MSG" "WARNING: Battery does not report a design capacity. Auto hibernation"
    log "MSG" "does not work without a design capacity."
    ENOUGH_CHARGE=1
    elif [ "$(($REMAINING * 100 / $CAPACITY))" -ge "$AUTO_HIBERNATION_BATTERY_CHARGE_PERCENT" ] ; then
    ENOUGH_CHARGE_TO_PREVENT_HIBERNATION=1
    fi
    fi
    # Fallback: hard values.
    # Determine the reporting unit.
    IN_MAH=0
    IN_MWH=0
    if ( grep -q mWh $BATT_INFO ) ; then
    IN_MWH=1
    elif ( grep -q mAh $BATT_INFO ) ; then
    IN_MAH=1
    fi
    if [ "$IN_MAH" -ne 0 ] ; then
    if [ "$MINIMUM_BATTERY_CHARGE_MAH" -ne 0 ] ; then
    FOUND_AN_ENABLED_CHECK=1
    if [ "$REMAINING" -ge "$MINIMUM_BATTERY_CHARGE_MAH" ] ; then
    ENOUGH_CHARGE=1
    fi
    fi
    if [ "$AUTO_HIBERNATION_BATTERY_CHARGE_MAH" -ne 0 ] ; then
    FOUND_AN_ENABLED_HIBERNATION_CHECK=1
    if [ "$REMAINING" -ge "$AUTO_HIBERNATION_BATTERY_CHARGE_MAH" ] ; then
    ENOUGH_CHARGE_TO_PREVENT_HIBERNATION=1
    fi
    fi
    elif [ "$IN_MWH" -ne 0 ] ; then
    if [ "$MINIMUM_BATTERY_CHARGE_MWH" -ne 0 ] ; then
    FOUND_AN_ENABLED_CHECK=1
    if [ "$REMAINING" -ge "$MINIMUM_BATTERY_CHARGE_MWH" ] ; then
    ENOUGH_CHARGE=1
    fi
    fi
    if [ "$AUTO_HIBERNATION_BATTERY_CHARGE_MWH" -ne 0 ] ; then
    FOUND_AN_ENABLED_HIBERNATION_CHECK=1
    if [ "$REMAINING" -ge "$AUTO_HIBERNATION_BATTERY_CHARGE_MWH" ] ; then
    ENOUGH_CHARGE_TO_PREVENT_HIBERNATION=1
    fi
    fi
    else
    log "ERR" "Failed to determine battery charge. Battery charge units are not in"
    log "ERR" "mWh or mAh."
    fi
    CAP_STATE=`sed -r 's/^capacity state:\s*(.*)\s*$/\1/;t;d' "$BATT_STATE"`
    if [ "$DISABLE_LAPTOP_MODE_ON_CRITICAL_BATTERY_LEVEL" -ne 0 ] ; then
    if [ "$CAP_STATE" = "critical" ] ; then
    # Restore the state we had before checking this battery, so that
    # this battery does not count as having enough charge.
    ENOUGH_CHARGE=$PREV_ENOUGH_CHARGE
    elif [ "$FOUND_AN_ENABLED_CHECK" -eq 0 ] ; then
    # This is the only check that is enabled. In that case a non-critical
    # battery level counts as "enough". (If we would count non-critical
    # battery levels as enough *always*, then the other settings would
    # have no effect; this is only a final fallback.)
    ENOUGH_CHARGE=1
    fi
    fi
    if [ "$AUTO_HIBERNATION_ON_CRITICAL_BATTERY_LEVEL" -ne 0 ] ; then
    if [ "$CAP_STATE" = "critical" ] ; then
    ENOUGH_CHARGE_TO_PREVENT_HIBERNATION=$PREV_ENOUGH_CHARGE_TO_PREVENT_HIBERNATION
    elif [ "$FOUND_AN_ENABLED_HIBERNATION_CHECK" -eq 0 ] ; then
    ENOUGH_CHARGE_TO_PREVENT_HIBERNATION=1
    fi
    fi
    else
    log "VERBOSE" "Battery is not present."
    fi
    done
    else
    ENOUGH_CHARGE=1
    ENOUGH_CHARGE_TO_PREVENT_HIBERNATION=1
    log "VERBOSE" "Not on AC and could not check battery state -- data loss sensitive features stay enabled and auto-hibernation will not work."
    fi
    if [ "$ENABLE_AUTO_HIBERNATION" -ne 0 -a "$ENOUGH_CHARGE_TO_PREVENT_HIBERNATION" -eq 0 ] ; then
    log "VERBOSE" "None of the batteries have a charge above the auto-hibernation level."
    log "VERBOSE" "Starting hibernation."
    if [ -x $HIBERNATE_COMMAND ]; then
    $HIBERNATE_COMMAND
    elif [ -f /sys/power/state ]; then
    grep -q disk /sys/power/state && echo disk > /sys/power/state
    fi
    # Don't continue -- if things are configured correctly, then we
    # will be called on resume.
    exit 0
    fi
    if [ "$ENOUGH_CHARGE" -eq 0 ] ; then
    log "VERBOSE" "None of the batteries have a charge above the minimum level."
    log "VERBOSE" "Deactivating data loss sensitive features."
    ACTIVATE_WITH_POSSIBLE_DATA_LOSS=0
    fi
    fi
    if [ "$INIT" -eq 0 ] ; then
    log "MSG" "Laptop mode "
    fi
    # WAS_ACTIVE is used later on. If there is no /var/run/laptop-mode-tools/state, then
    # we know that laptop mode wasn't active before.
    WAS_ACTIVE=0
    log "VERBOSE" "Checking if desired state is different from current state."
    if [ -f /var/run/laptop-mode-tools/state ] ; then
    read WAS_ACTIVE WAS_ON_AC WAS_ACTIVATE_WITH_POSSIBLE_DATA_LOSS WAS_STATE < /var/run/laptop-mode-tools/state
    if [ "$WAS_STATE" != "" ] ; then
    if [ "$WAS_ACTIVE" -eq "$ACTIVATE" -a "$WAS_ON_AC" -eq "$ON_AC" -a "$WAS_ACTIVATE_WITH_POSSIBLE_DATA_LOSS" -eq "$ACTIVATE_WITH_POSSIBLE_DATA_LOSS" -a "$WAS_STATE" = "$STATE" -a "$FORCE" -eq 0 ] ; then
    log "MSG" "$STATE, "
    if [ "$WAS_ACTIVE" -eq 1 ] ; then
    log "MSG" "active [unchanged]"
    if [ "$ACTIVATE_WITH_POSSIBLE_DATA_LOSS" -eq 0 ] ; then
    log "MSG" " (Data-loss sensitive features disabled.)"
    fi
    else
    log "MSG" "not active [unchanged]"
    fi
    exit 0
    fi
    fi
    else
    log "VERBOSE" "/var/run/laptop-mode-tools/state does not exist, no previous state."
    fi
    echo "$ACTIVATE $ON_AC $ACTIVATE_WITH_POSSIBLE_DATA_LOSS $STATE" > /var/run/laptop-mode-tools/state
    if [ "$ACTIVATE" -eq 1 ] ; then
    log "MSG" "$STATE, active"
    if [ "$ACTIVATE_WITH_POSSIBLE_DATA_LOSS" -eq 0 ] ; then
    log "MSG" " (Data-loss sensitive features disabled.)"
    fi
    else
    log "MSG" "$STATE, not active"
    fi
    # Finally, call laptop-mode-tools modules. The modules can use the settings
    # from the config files, but they may NOT assume the settings actually exist,
    # as no defaults have been given for them.
    # Note that the /usr/local/lib path is deprecated.
    export FORCE STATE ON_AC ACTIVATE ACTIVATE_WITH_POSSIBLE_DATA_LOSS KLEVEL KMINOR WAS_ACTIVE LM_VERBOSE DEVICES
    for SCRIPT in /usr/share/laptop-mode-tools/modules/* /usr/local/lib/laptop-mode-tools/modules/* /usr/local/share/laptop-mode-tools/modules/* /etc/laptop-mode/modules/* ; do
    if [ -z "$MODULES" ] ; then
    # If a module list has not been provided, execute all modules
    EXECUTE_SCRIPT=1
    else
    # If a module list has been provided, execute only the listed
    # modules.
    EXECUTE_SCRIPT=0
    for MODULE in $MODULES; do
    # Attempt to remove the module name from the end of the
    # full script path. If the module name matches the
    # script, the name will be removed from the end of the
    # full file path, leaving the path to the script. If
    # there was not a match made, the module name would not
    # be removed from the path, and $PATH_TO_SCRIPT would
    # be the same as $SCRIPT.
    PATH_TO_SCRIPT=${SCRIPT%%$MODULE}
    # Execute the script if a match was found (module name
    # was removed from the script path, making it shorter.
    if [ $PATH_TO_SCRIPT != $SCRIPT ] ; then
    EXECUTE_SCRIPT=1
    fi
    done
    fi
    if [ -x "$SCRIPT" -a $EXECUTE_SCRIPT -eq 1 ] ; then
    log "VERBOSE" "Invoking module $SCRIPT."
    SCRIPT_DEBUG=$SCRIPT; # We do this because in start-stop-programs module a $SCRIPT variable is used. That
    # changes the whole meaning when passed to disableDebug ()
    enableDebug $SCRIPT_DEBUG;
    . $SCRIPT
    disableDebug $SCRIPT_DEBUG;
    else
    log "VERBOSE" "Module $SCRIPT is not executable or is to be skipped."
    fi
    done
    exit 0
    # This fi closes the if for "readconfig". If I would have indented this one
    # I would have indented the whole file. :)
    fi
    lmt_load_config
    lock_retry ()
    ( $FLOCK -n -x -w 1 8 || exit 0;
    i=10;
    while [ $i -ge 1 ]
    do
    log "ERR" "Couldn't acquire lock. Retrying.... PID is $$\n"
    $FLOCK -x -w 1 9 && lmt_main_function "$@" && break;
    i=$(( $i - 1 ))
    done
    ) 8>$LMT_REQ_LOCK
    # Check and acquire locks and then exec.
    ( $FLOCK -n -x -w 1 8; ) 8>$LMT_REQ_LOCK
    ($FLOCK -n -x -w 1 9 && lmt_main_function "$@";) || lock_retry "$@"
    ) 9<>$LMT_INVOC_LOCK
    # We do a special run of battery polling daemon here so that it does not get
    # plagued by the lock. We need the polling daemon to be independent of any locks
    if [ x$ENABLE_BATTERY_LEVEL_POLLING = x1 ] && [ x$BLACKLIST_IN_FLOCK = x1 ]; then
    log "VERBOSE" "Battery level polling is enabled."
    if [ x$ON_AC = x1 ] ; then
    log "VERBOSE" "On AC, stopping the polling daemon."
    # In AC mode we disable the polling daemon.
    killall -q lm-polling-daemon
    else
    if ! pidof -x lm-polling-daemon ; then
    log "VERBOSE" "On battery and there was no polling daemon yet, starting the polling daemon."
    # If there is no polling daemon, we start one.
    /usr/share/laptop-mode-tools/module-helpers/lm-polling-daemon < /dev/null > /dev/null 2> /dev/null &
    fi
    fi
    else
    log "VERBOSE" "Battery level polling is disabled."
    fi
    exit 0;
    and here is the lines which archwiki mentions
    case "$KLEVEL" in
    "2.4" ) ;;
    "2.6" ) ;;
    log "ERR" "Unhandled kernel version: $KLEVEL ('uname -r' = '$(uname -r)')" >&2
    exit 1
    esac

    I had the problem but edited the line in /usr/sbin/laptop_mode and it worked. But thoes lines are not there anymore. I guess they changed it at the recent update of laptop-mode-tools.
    Regarding your heat problem; is there any other thing you use to cut down power usage (from AUR  maybe)? I use acpi_call from AUR had to edit lines there aswell, but it should be updated by now.

  • Laptop-mode-tools fixes and improvements

    I have been in contact with the autor of laptop-mode-tools and new version is coming some time next month or maybe even in March. So I decided to share my tweaks because some things are broken right now and some need improvements.
    There are some modules I don't use and so didn't notice any problems with them, if there are any (lcd-brightness, video-out and those for which I don't have suitable hardware like cpufreq, iwl/ipw and sched-mc).
    Alright then, first is the problem with systems where the battery doesn't report events and has no alarm support on which the auto-hibernate module depends. There is a script from gentoo-wiki which is quite popular among people with lousy batteries. It would be great if the package manager would take care of it for us. Author of laptop-mode-tools also said (on debian lists) that such script could be included in future versions, for now the common "solution" is to create a cronjob that calls /usr/sbin/laptop_mode every few minutes. I don't quite like it compared to the gentoo script. For now I include the script in the package as /usr/sbin/battery_mode and call it from rc.local on boot.
    Currently there is a module called ac97-powersave that controls power management on those sound cards. Intel HDA sound cards also support this and in the future versions a module them will probably be included. For now I patch the ac97-powersave module to include the support for Intel HDA.
    Bluetooth module removes bluetooth and hci_usb modules when disabling the device. However on my system it's not enough to completly turn it off. For now I patch the bluetooth module to include rfkill support. Only then the system reports a USB disconnect and the LED goes off. The default path in the patch is for my acer system with acer-wmi rfkill support.
    Due to w differences the dpms-standby module is broken on many systems. The module uses xset and arguments are piped from the command w -hs where the third field is supposed to be DPMS_SCREEN but it's actually IDLE time, so xset command fails because the argument passed to xset -d is something like 4:54. On Debian/Ubuntu they went around this by including this in their acpi-support package. I didn't bother to see what they actually did, to backport it. It should be done in future laptop-mode-tools anyway. For now I just hardcode the display value for my single-user/one-X-screen system in the dpms-standby module.
    Due to a simple mistake LM_VERBOSE was broken. Meaning that none of those informative status messages from laptop-mode-tools were logged when VERBOSE LOGGING was enabled. Only the output of called commands was logged. For now I fix this in the build process.
    Speaking of logging, default output for verbose is /dev/stdout, and I would like to log everything to a file. So I modify it in the build process to log everything to /var/log/laptop-mode.log, and also include a logrotate script in the package. With the above fix I have a complete and informative log file.
    It's not a bad idea to stop/restart laptop-mode-tools when suspending, so a pm-utils hook is helpful. Arch PKGBUILD already includes installing pm-utils support but it's actually pbbuttonsd/pmud support and not pm-utils. Such a script/hook could one day be included in laptop-mode-tools however there is/was a debate going if it's their job to provide it. I read somewhere that Ubuntu already provides such script/hook but I'm not sure if it's provided by acpi-support or laptop-mode-tools package. For now I wrote my own pm-utils hook and I include it in the build process.
    Powertop suggests usbcore.autosuspend=1 sysctl, but it would be nice if we have all this power management control in one place. Usb-autosuspend module will be included in future versions of laptop-mode-tools, but for now someone wrote a module and posted it to the Debian bug tracker. I keep the module and configuration in my build dir but don't include it in the final package for now. I'll wait a bit and see how things will develop.
    To help you start hacking on laptop-mode-tools you can take a look at all the above patches and my PKGBUILD. Every step is documented in PKGBUILD comments, and please do check them because some things I patch but some I modify inline with sed. I also don't install acpid handlers and before mentioned false pm-utils support... everything is commented: http://sysphere.org/~anrxc/local/softwa … ode-tools/

    Hello,
    this was one year ago, and I helped the author improve these things. Today I don't have to patch my laptop-mode-tools... (I still do with some minor things, but that's just to satisfy some personal preferences . Use the arch package, even the battery polling helper is included.

  • Start/stop user programs with laptop-mode

    Hi,
    i am trying to place some scripts in /etc/laptop-mode/*start[stop] to kill and start some programs when on battery or ac.
    I tried with the following script, but the process is just a zombie and dropbox will not appear: any ideas?
    #!/bin/bash
    case "$1" in
    start)
    su pschw -c
    /opt/dropbox/dropbox &
    stop)
    killall dropbox
    echo failed!
    esac

    Hi,
    i am trying to place some scripts in /etc/laptop-mode/*start[stop] to kill and start some programs when on battery or ac.
    I tried with the following script, but the process is just a zombie and dropbox will not appear: any ideas?
    #!/bin/bash
    case "$1" in
    start)
    su pschw -c
    /opt/dropbox/dropbox &
    stop)
    killall dropbox
    echo failed!
    esac

  • Laptop-mode-tools loops on lock_retry()

    I have been struggling with laptop-mode-tools for a while, so I am finally posting here.
    Short version:
    laptop-mode-tools never does anything on acpi events. Here is what happens in /var/log/everything.log when I unplug the ac adaptor:
    Jan 29 17:20:25 localhost laptop-mode: Determining power state from /sys/class/power_supply/ACAD/online.
    Jan 29 17:20:25 localhost laptop-mode: Not trying other options, already found a power supply.
    Jan 29 17:20:25 localhost laptop-mode: Battery level polling is disabled.
    Jan 29 17:20:25 localhost laptop-mode: Prelim lock acquisition on descriptor 8 with pid 8098
    Jan 29 17:20:25 localhost laptop-mode: Couldn't acquire prelim lock on descriptor 9 with pid 8098
    Jan 29 17:20:25 localhost laptop-mode: Now invoking lock_retry with arguments -- auto
    Jan 29 17:20:25 localhost kernel: [ 2961.821328] EXT4-fs (sda5): re-mounted. Opts: commit=300,commit=600
    Jan 29 17:20:26 localhost laptop-mode: Couldn't acquire lock on descriptor 9 in lock_retry(). Retrying.... PID is 8098\n
    Jan 29 17:20:27 localhost laptop-mode: Couldn't acquire lock on descriptor 9 in lock_retry(). Retrying.... PID is 8098\n
    Jan 29 17:20:28 localhost laptop-mode: Couldn't acquire lock on descriptor 9 in lock_retry(). Retrying.... PID is 8098\n
    Jan 29 17:20:29 localhost laptop-mode: Couldn't acquire lock on descriptor 9 in lock_retry(). Retrying.... PID is 8098\n
    Jan 29 17:20:30 localhost laptop-mode: Couldn't acquire lock on descriptor 9 in lock_retry(). Retrying.... PID is 8098\n
    Jan 29 17:20:31 localhost laptop-mode: Couldn't acquire lock on descriptor 9 in lock_retry(). Retrying.... PID is 8098\n
    Jan 29 17:20:32 localhost laptop-mode: Couldn't acquire lock on descriptor 9 in lock_retry(). Retrying.... PID is 8098\n
    Jan 29 17:20:33 localhost laptop-mode: Couldn't acquire lock on descriptor 9 in lock_retry(). Retrying.... PID is 8098\n
    Jan 29 17:20:34 localhost laptop-mode: Couldn't acquire lock on descriptor 9 in lock_retry(). Retrying.... PID is 8098\n
    Jan 29 17:20:35 localhost laptop-mode: Couldn't acquire lock on descriptor 9 in lock_retry(). Retrying.... PID is 8098\n
    Jan 29 17:20:35 localhost laptop-mode: Determining power state from /sys/class/power_supply/ACAD/online.
    Jan 29 17:20:35 localhost laptop-mode: Not trying other options, already found a power supply.
    Jan 29 17:20:35 localhost laptop-mode: Battery level polling is disabled.
    Jan 29 17:20:35 localhost laptop-mode: Prelim lock acquisition on descriptor 8 with pid 8188
    Jan 29 17:20:35 localhost laptop-mode: Couldn't acquire prelim lock on descriptor 9 with pid 8188
    Jan 29 17:20:35 localhost laptop-mode: Now invoking lock_retry with arguments -- auto
    Jan 29 17:20:36 localhost laptop-mode: Couldn't acquire lock on descriptor 9 in lock_retry(). Retrying.... PID is 8188\n
    Jan 29 17:20:37 localhost laptop-mode: Couldn't acquire lock on descriptor 9 in lock_retry(). Retrying.... PID is 8188\n
    Jan 29 17:20:38 localhost laptop-mode: Couldn't acquire lock on descriptor 9 in lock_retry(). Retrying.... PID is 8188\n
    Jan 29 17:20:39 localhost laptop-mode: Couldn't acquire lock on descriptor 9 in lock_retry(). Retrying.... PID is 8188\n
    Jan 29 17:20:40 localhost laptop-mode: Couldn't acquire lock on descriptor 9 in lock_retry(). Retrying.... PID is 8188\n
    Jan 29 17:20:41 localhost laptop-mode: Couldn't acquire lock on descriptor 9 in lock_retry(). Retrying.... PID is 8188\n
    Jan 29 17:20:42 localhost laptop-mode: Couldn't acquire lock on descriptor 9 in lock_retry(). Retrying.... PID is 8188\n
    Jan 29 17:20:43 localhost laptop-mode: Couldn't acquire lock on descriptor 9 in lock_retry(). Retrying.... PID is 8188\n
    Jan 29 17:20:44 localhost laptop-mode: Couldn't acquire lock on descriptor 9 in lock_retry(). Retrying.... PID is 8188\n
    Jan 29 17:20:45 localhost laptop-mode: Couldn't acquire lock on descriptor 9 in lock_retry(). Retrying.... PID is 8188\n
    To obtain this log, I switched to 1 the variables VERBOSE_OUTPUT, LOG_TO_SYSLOG and DEBUG in /etc/laptop-mode/laptop-mode.conf
    long version:
    If I understand correctly, when the ac adapter is unplugged, the script /etc/acpi/events/lm_ac_adapter (which basically grabs every acpi events starting with ac_adapter), triggers the script /etc/acpi/actions/lm_ac_adapter.sh, and this action triggers the command '/usr/sbin/laptop_mode auto'
    I could check that acpid does its work correctly by modifying /etc/acpi/actions/lm_ac_adapter.sh and checking it is called immediately when I unplug the adapter, so I tried to manually call '/usr/sbin/laptop_mode auto' after unplugging the adapter, and I discovered that laptop_mode gets stuck in calling lock_retry() 10 times and then exists.
    See this paste: http://pastie.org/3276821
    Any idea how to fix that?
    Last edited by duquesnc (2012-01-29 17:26:05)

    lucke wrote:Perhaps you have a battery-level-polling.conf.pacnew file in /etc/laptop-mode/conf.d/ - merging the changes might help.
    No, this installation is brand new (I just got this laptop).
    Removing lmt-*.lock files from /var/lock/ after having stopped the laptop-mode "daemon" could (temporarily?) help.
    Trying to apply this advice, I realized something strange: calling 'rc.d stop laptop-mode' does not really stop laptop-mode:
    I first reboot the laptop in order to get rid of everything I could have done previously that could mess with the daemon. Then I check the lock files you mentionned exist:
    ls /var/lock/lmt-*.lock
    /var/lock/lmt-battpoll.lock /var/lock/lmt-invoc.lock /var/lock/lmt-req.lock
    Then, when calling
    rc.d stop laptop-mode
    I get in /var/log/everything.log:
    Jan 29 18:47:08 localhost laptop-mode: Now invoking lock_retry with arguments -- stop
    Jan 29 18:47:09 localhost laptop-mode: Couldn't acquire lock on descriptor 9 in lock_retry(). Retrying.... PID is 20296\n
    Jan 29 18:47:10 localhost laptop-mode: Couldn't acquire lock on descriptor 9 in lock_retry(). Retrying.... PID is 20296\n
    Jan 29 18:47:11 localhost laptop-mode: Couldn't acquire lock on descriptor 9 in lock_retry(). Retrying.... PID is 20296\n
    Jan 29 18:47:12 localhost laptop-mode: Couldn't acquire lock on descriptor 9 in lock_retry(). Retrying.... PID is 20296\n
    Jan 29 18:47:13 localhost laptop-mode: Couldn't acquire lock on descriptor 9 in lock_retry(). Retrying.... PID is 20296\n
    Jan 29 18:47:14 localhost laptop-mode: Couldn't acquire lock on descriptor 9 in lock_retry(). Retrying.... PID is 20296\n
    Jan 29 18:47:15 localhost laptop-mode: Couldn't acquire lock on descriptor 9 in lock_retry(). Retrying.... PID is 20296\n
    Jan 29 18:47:16 localhost laptop-mode: Couldn't acquire lock on descriptor 9 in lock_retry(). Retrying.... PID is 20296\n
    Jan 29 18:47:17 localhost laptop-mode: Couldn't acquire lock on descriptor 9 in lock_retry(). Retrying.... PID is 20296\n
    Jan 29 18:47:18 localhost laptop-mode: Couldn't acquire lock on descriptor 9 in lock_retry(). Retrying.... PID is 20296\n
    If I check /var/lock/lmt-*.lock after that, all the files are still there (they were not removed)
    ls /var/lock/lmt-*.lock
    /var/lock/lmt-battpoll.lock /var/lock/lmt-invoc.lock /var/lock/lmt-req.lock
    If I unplug the laptop after having stopped laptop-mode, I still get messages from laptop-mode in /var/log/everything.log!!!
    Jan 29 18:53:06 localhost laptop-mode: Determining power state from /sys/class/power_supply/ACAD/online.
    Jan 29 18:53:06 localhost laptop-mode: Not trying other options, already found a power supply.
    Jan 29 18:53:06 localhost laptop-mode: Battery level polling is enabled.
    Jan 29 18:53:06 localhost laptop-mode: Lock acquisition on descriptor 7 failed with pid 20828
    Jan 29 18:53:06 localhost laptop-mode: Prelim lock acquisition on descriptor 8 with pid 20828
    Jan 29 18:53:06 localhost laptop-mode: Couldn't acquire prelim lock on descriptor 9 with pid 20828
    Jan 29 18:53:06 localhost laptop-mode: Now invoking lock_retry with arguments -- auto
    Jan 29 18:53:06 localhost kernel: [ 8514.884884] EXT4-fs (sda5): re-mounted. Opts: commit=300,commit=600
    Jan 29 18:53:07 localhost laptop-mode: Couldn't acquire lock on descriptor 9 in lock_retry(). Retrying.... PID is 20828\n
    Jan 29 18:53:08 localhost laptop-mode: Couldn't acquire lock on descriptor 9 in lock_retry(). Retrying.... PID is 20828\n
    Jan 29 18:53:09 localhost laptop-mode: Couldn't acquire lock on descriptor 9 in lock_retry(). Retrying.... PID is 20828\n
    Jan 29 18:53:10 localhost laptop-mode: Couldn't acquire lock on descriptor 9 in lock_retry(). Retrying.... PID is 20828\n
    Jan 29 18:53:11 localhost laptop-mode: Couldn't acquire lock on descriptor 9 in lock_retry(). Retrying.... PID is 20828\n
    Jan 29 18:53:12 localhost laptop-mode: Couldn't acquire lock on descriptor 9 in lock_retry(). Retrying.... PID is 20828\n
    Jan 29 18:53:13 localhost laptop-mode: Couldn't acquire lock on descriptor 9 in lock_retry(). Retrying.... PID is 20828\n
    Jan 29 18:53:14 localhost laptop-mode: Couldn't acquire lock on descriptor 9 in lock_retry(). Retrying.... PID is 20828\n
    Jan 29 18:53:15 localhost laptop-mode: Couldn't acquire lock on descriptor 9 in lock_retry(). Retrying.... PID is 20828\n
    Jan 29 18:53:16 localhost laptop-mode: Couldn't acquire lock on descriptor 9 in lock_retry(). Retrying.... PID is 20828\n
    Jan 29 18:53:16 localhost laptop-mode: Determining power state from /sys/class/power_supply/ACAD/online.
    Jan 29 18:53:16 localhost laptop-mode: Not trying other options, already found a power supply.
    Jan 29 18:53:16 localhost laptop-mode: Battery level polling is enabled.
    Jan 29 18:53:16 localhost laptop-mode: Lock acquisition on descriptor 7 failed with pid 20920
    Jan 29 18:53:16 localhost laptop-mode: Prelim lock acquisition on descriptor 8 with pid 20920
    Jan 29 18:53:16 localhost laptop-mode: Couldn't acquire prelim lock on descriptor 9 with pid 20920
    Jan 29 18:53:16 localhost laptop-mode: Now invoking lock_retry with arguments -- auto
    Jan 29 18:53:17 localhost laptop-mode: Couldn't acquire lock on descriptor 9 in lock_retry(). Retrying.... PID is 20920\n
    Jan 29 18:53:18 localhost laptop-mode: Couldn't acquire lock on descriptor 9 in lock_retry(). Retrying.... PID is 20920\n
    Jan 29 18:53:19 localhost laptop-mode: Couldn't acquire lock on descriptor 9 in lock_retry(). Retrying.... PID is 20920\n
    Jan 29 18:53:20 localhost laptop-mode: Couldn't acquire lock on descriptor 9 in lock_retry(). Retrying.... PID is 20920\n
    Jan 29 18:53:21 localhost laptop-mode: Couldn't acquire lock on descriptor 9 in lock_retry(). Retrying.... PID is 20920\n
    Jan 29 18:53:22 localhost laptop-mode: Couldn't acquire lock on descriptor 9 in lock_retry(). Retrying.... PID is 20920\n
    Jan 29 18:53:23 localhost laptop-mode: Couldn't acquire lock on descriptor 9 in lock_retry(). Retrying.... PID is 20920\n
    Jan 29 18:53:24 localhost laptop-mode: Couldn't acquire lock on descriptor 9 in lock_retry(). Retrying.... PID is 20920\n
    Jan 29 18:53:25 localhost laptop-mode: Couldn't acquire lock on descriptor 9 in lock_retry(). Retrying.... PID is 20920\n
    Jan 29 18:53:26 localhost laptop-mode: Couldn't acquire lock on descriptor 9 in lock_retry(). Retrying.... PID is 20920\n
    When I remove the files, I can stop laptop-mode for good, but when I restart it, it re-creates them and the problems start again after the next acpi event...
    Last edited by duquesnc (2012-01-29 18:10:23)

  • Laptop-mode causing unresponsive ttys or cryptic error messages

    I installed laptop-mode-tools at the same time I installed arch by following the wiki. For a long time it worked great.
    A few months ago, however, I started noticing strange messages showing up in the stream of text that shows when you boot up (tells the state of fsck for example). It would say occassionally, "enabled, not active" in that stream, and when it did that, at the login for tty1 it would say "Failed." where you should type in your username, and then another line that also said "Failed."
    Like this:
    Arch Linux 3.10.3-1-ARCH (tty1)
    Hint: Num Lock on
    destruct-o-bot login: Failed.
    Failed.
    It would let you type in your username blind though when that happened and it would all work fine.
    Other times you would see the "enabled, not active" message and when it came time to log in to tty1, it would flicker briefly and then go blank and remain unresponsive. So I would switch to tty2, and the same thing could (but might not always) happen, and so on through tty3-tty6.
    I finally tracked it down to being laptop mode tools. Here is what it prints out when I run systemctl start laptop-mode.service:
    /usr/share/laptop-mode-tools/modules/pcie-aspm: line 10: echo: write error: Operation not permitted
    Failed.
    Failed.
    and here is what it prints out on tty1 when I run systemctl stop laptop-mode.service:
    disabled, not active
    /usr/share/laptop-mode-tools/modules/pcie-aspm: line 10: echo: write error: Operation not permitted
    disabled, not active
    Those two things exactly correspond to the lines of output when I'm booting up or shutting down. And when I disable laptop-mode.service, no more problems.
    I can't find anything about this problem online. How can I fix it? Has anyone else ever heard of these issues?

    It looks related. I'm not really worried about the messages, per se, though. If that were all it did, I would just ignore it. WHat I'm bothered by is the terminals that don't work.
    # journalctl -b | tail -30
    Aug 04 10:24:09 destruct-o-bot slim[542]: (II) AIGLX: Suspending AIGLX clients for VT switch
    Aug 04 10:24:09 destruct-o-bot systemd[1]: Starting Getty on tty2...
    Aug 04 10:24:09 destruct-o-bot systemd[1]: Started Getty on tty2.
    Aug 04 10:24:09 destruct-o-bot systemd[1]: [email protected] holdoff time over, scheduling restart.
    Aug 04 10:24:09 destruct-o-bot systemd[1]: Stopping Getty on tty2...
    Aug 04 10:24:09 destruct-o-bot systemd[1]: Starting Getty on tty2...
    Aug 04 10:24:09 destruct-o-bot systemd[1]: Started Getty on tty2.
    Aug 04 10:24:09 destruct-o-bot systemd[1]: [email protected] holdoff time over, scheduling restart.
    Aug 04 10:24:09 destruct-o-bot systemd[1]: Stopping Getty on tty2...
    Aug 04 10:24:09 destruct-o-bot systemd[1]: Starting Getty on tty2...
    Aug 04 10:24:09 destruct-o-bot systemd[1]: Started Getty on tty2.
    Aug 04 10:24:10 destruct-o-bot systemd[1]: Starting Getty on tty3...
    Aug 04 10:24:10 destruct-o-bot systemd[1]: Started Getty on tty3.
    Aug 04 10:24:10 destruct-o-bot systemd[1]: [email protected] holdoff time over, scheduling restart.
    Aug 04 10:24:10 destruct-o-bot systemd[1]: Stopping Getty on tty3...
    Aug 04 10:24:10 destruct-o-bot systemd[1]: Starting Getty on tty3...
    Aug 04 10:24:10 destruct-o-bot systemd[1]: Started Getty on tty3.
    Aug 04 10:24:11 destruct-o-bot systemd[1]: Starting Getty on tty4...
    Aug 04 10:24:11 destruct-o-bot systemd[1]: Started Getty on tty4.
    Aug 04 10:24:11 destruct-o-bot systemd[1]: [email protected] holdoff time over, scheduling restart.
    Aug 04 10:24:11 destruct-o-bot systemd[1]: Stopping Getty on tty4...
    Aug 04 10:24:11 destruct-o-bot systemd[1]: Starting Getty on tty4...
    Aug 04 10:24:11 destruct-o-bot systemd[1]: Started Getty on tty4.
    Aug 04 10:24:12 destruct-o-bot systemd[1]: Starting Getty on tty5...
    Aug 04 10:24:12 destruct-o-bot systemd[1]: Started Getty on tty5.
    Aug 04 10:24:13 destruct-o-bot systemd[1]: Starting Getty on tty6...
    Aug 04 10:24:13 destruct-o-bot systemd[1]: Started Getty on tty6.
    Aug 04 10:24:22 destruct-o-bot slim[542]: (II) AIGLX: Suspending AIGLX clients for VT switch
    Aug 04 10:24:29 destruct-o-bot sudo[1949]: scott : TTY=tty1 ; PWD=/home/scott ; USER=root ; COMMAND=/usr/bin/journalctl -b
    Aug 04 10:24:29 destruct-o-bot sudo[1949]: pam_unix(sudo:session): session opened for user root by scott(uid=0)
    See all the times on tty2 that it tried to restart? Then it ultimately failed. tty3 restarted a couple times too, but it didn't fail.
    This behaviour doesn't occur without laptop-mode. I just was hoping to see if this was a known bug... I can't see why these two services would be interrelated at all. It doesn't look like it so I might just have to file a bug report.
    Time will tell.
    Last edited by scott_fakename (2013-08-04 15:33:35)

  • Laptop-mode-tools issue with log / logger

    I had an issue with laptop-mode-tools where systemd reported it failed (the laptop-mode service). Specifically I got an error with wireless-power in /usr/share/laptop-mode/modules/. Clearly one issue was that I did not install wireless_tools. But I had another issue: It complained with "log: command not found" so I looked into the file and there were several calls to "log [...]". I changed them to "logger [...]" and the error is gone.
    Am I missing something here or is this really an issue? Maybe a bug? Or an error on my side?

    I had the problem but edited the line in /usr/sbin/laptop_mode and it worked. But thoes lines are not there anymore. I guess they changed it at the recent update of laptop-mode-tools.
    Regarding your heat problem; is there any other thing you use to cut down power usage (from AUR  maybe)? I use acpi_call from AUR had to edit lines there aswell, but it should be updated by now.

  • Laptop-Mode messes up Wifi

    My Laptop is a Lenovo Edge E320 with a Intel Centrino Wireless-N 1000. My wifi was working a few months ago pretty fine with laptop-mode-tools enabled, but since a system upgrade about 3 months ago I can't connect to anything if I have laptop-mode-tools enabled and run on battery. I even turned off power management in /etc/laptop-mode/conf.d/wireless*, but the problem is still present.
    iwconfig reports nothing unusual, setting txpower manually to max doesn't help. However, with power management disabled I get a few networks, with lower signals than the one I want to connect to (again, txpower at max). Reloading the driver via rmmod iwlwifi; modprobe iwlwifi 11n_disable=1 swcrypto=1 works, although it's an unnecessary effort to do this every time I want to use my laptop with laptop-mode.
    Any ideas?
    Additional info:
    dmesg | grep iwlwifi
    [ 7.574104] iwlwifi 0000:02:00.0: PCI INT A -> GSI 17 (level, low) -> IRQ 17
    [ 7.574114] iwlwifi 0000:02:00.0: setting latency timer to 64
    [ 7.574177] iwlwifi 0000:02:00.0: pci_resource_len = 0x00002000
    [ 7.574179] iwlwifi 0000:02:00.0: pci_resource_base = ffffc90005b60000
    [ 7.574181] iwlwifi 0000:02:00.0: HW Revision ID = 0x0
    [ 7.574271] iwlwifi 0000:02:00.0: irq 41 for MSI/MSI-X
    [ 7.574308] iwlwifi 0000:02:00.0: Detected Intel(R) Centrino(R) Wireless-N 1000 BGN, REV=0x6C
    [ 7.574373] iwlwifi 0000:02:00.0: L1 Disabled; Enabling L0S
    [ 7.595753] iwlwifi 0000:02:00.0: device EEPROM VER=0x15d, CALIB=0x6
    [ 7.595755] iwlwifi 0000:02:00.0: Device SKU: 0X50
    [ 7.595756] iwlwifi 0000:02:00.0: Valid Tx ant: 0X1, Valid Rx ant: 0X3
    [ 7.595764] iwlwifi 0000:02:00.0: Tunable channels: 13 802.11bg, 0 802.11a channels
    [ 7.848327] iwlwifi 0000:02:00.0: loaded firmware version 39.31.5.1 build 35138
    [ 15.217495] iwlwifi 0000:02:00.0: L1 Disabled; Enabling L0S
    [ 15.278254] iwlwifi 0000:02:00.0: L1 Disabled; Enabling L0S
    [ 24.468691] iwlwifi 0000:02:00.0: Error sending POWER_TABLE_CMD: time out after 2000ms.
    [ 24.468702] iwlwifi 0000:02:00.0: Current CMD queue read_ptr 24 write_ptr 25
    [ 24.468709] iwlwifi 0000:02:00.0: set power fail, ret = -110
    [ 38.101889] iwlwifi 0000:02:00.0: Error sending REPLY_SCAN_CMD: time out after 2000ms.
    [ 38.101909] iwlwifi 0000:02:00.0: Current CMD queue read_ptr 24 write_ptr 26
    [ 68.060549] iwlwifi 0000:02:00.0: Error sending REPLY_SCAN_CMD: time out after 2000ms.
    [ 68.060565] iwlwifi 0000:02:00.0: Current CMD queue read_ptr 24 write_ptr 27
    Last edited by arys (2012-03-18 14:13:27)

    Noticed the same problem on Thinkpad X230, except in my case iwlwifi module crashes with the below kernel log. Stopping laptop-mode service altogether fixes it -- disabling wireless-* part of laptop-mode however does not.
    Gonna try to change IWL_BATT_POWER and will report back how it goes.
    It did start happening after last kernel upgrade, likely!
    Oct 20 08:46:27 localhost kernel: [ 1452.045321] ------------[ cut here ]------------
    Oct 20 08:46:27 localhost kernel: [ 1452.045341] WARNING: at drivers/net/wireless/iwlwifi/iwl-io.c:127 iwl_grab_nic_access+0x7f/0xf0 [iwlwifi]()
    Oct 20 08:46:27 localhost kernel: [ 1452.045343] Hardware name: 2306CTO
    Oct 20 08:46:27 localhost kernel: [ 1452.045345] Timeout waiting for hardware access (CSR_GP_CNTRL 0xffffffff)
    Oct 20 08:46:27 localhost kernel: [ 1452.045347] Modules linked in: sha1_ssse3 sha1_generic ecb ppp_mppe ppp_async crc_ccitt ppp_generic slhc fuse iTCO_wdt iTCO_vendor_support snd_hda_codec_hdmi snd_hda_codec_realtek btusb bl
    uetooth arc4 microcode aesni_intel aes_x86_64 aes_generic uvcvideo ghash_clmulni_intel cryptd videobuf2_vmalloc videobuf2_memops kvm_intel videobuf2_core videodev kvm media coretemp crc32c_intel iwlwifi sdhci_pci sdhci thinkp
    ad_acpi mmc_core lpc_ich mac80211 serio_raw snd_hda_intel mfd_core pcspkr psmouse i2c_i801 snd_hda_codec snd_hwdep snd_pcm nvram cfg80211 snd_page_alloc e1000e rfkill snd_timer tpm_tis snd mei soundcore ac tpm battery tpm_bio
    s evdev wmi cpufreq_userspace cpufreq_powersave thermal acpi_cpufreq mperf processor ext4 crc16 jbd2 mbcache sd_mod ahci libahci xhci_hcd ehci_hcd libata scsi_mod usbcore usb_common i915 video button i2c_algo_bit intel_agp in
    tel_gtt drm_kms_helper drm i2c_core
    Oct 20 08:46:27 localhost kernel: [ 1452.045426] Pid: 0, comm: swapper/2 Not tainted 3.5.6-1-ARCH #1
    Oct 20 08:46:27 localhost kernel: [ 1452.045428] Call Trace:
    Oct 20 08:46:27 localhost kernel: [ 1452.045430] <IRQ> [<ffffffff81051a3f>] warn_slowpath_common+0x7f/0xc0
    Oct 20 08:46:27 localhost kernel: [ 1452.045442] [<ffffffff81051b36>] warn_slowpath_fmt+0x46/0x50
    Oct 20 08:46:27 localhost kernel: [ 1452.045453] [<ffffffffa046db68>] ? iwl_grab_nic_access_silent+0x188/0x200 [iwlwifi]
    Oct 20 08:46:27 localhost kernel: [ 1452.045462] [<ffffffffa046dc5f>] iwl_grab_nic_access+0x7f/0xf0 [iwlwifi]
    Oct 20 08:46:27 localhost kernel: [ 1452.045470] [<ffffffffa046e0db>] iwl_read_prph+0x3b/0x180 [iwlwifi]
    Oct 20 08:46:27 localhost kernel: [ 1452.045476] [<ffffffff8108ed7c>] ? trigger_load_balance+0x6c/0x270
    Oct 20 08:46:27 localhost kernel: [ 1452.045485] [<ffffffffa047fc9e>] iwl_trans_pcie_queue_stuck_timer+0xbe/0x180 [iwlwifi]
    Oct 20 08:46:27 localhost kernel: [ 1452.045493] [<ffffffffa047fbe0>] ? iwl_trans_rxq_free_rx_bufs+0xf0/0xf0 [iwlwifi]
    Oct 20 08:46:27 localhost kernel: [ 1452.045498] [<ffffffff810621c5>] run_timer_softirq+0x135/0x3c0
    Oct 20 08:46:27 localhost kernel: [ 1452.045503] [<ffffffff8101b9d9>] ? read_tsc+0x9/0x20
    Oct 20 08:46:27 localhost kernel: [ 1452.045509] [<ffffffff8105a490>] __do_softirq+0xb0/0x210
    Oct 20 08:46:27 localhost kernel: [ 1452.045513] [<ffffffff810a88b4>] ? tick_program_event+0x24/0x30
    Oct 20 08:46:27 localhost kernel: [ 1452.045519] [<ffffffff8148ab5c>] call_softirq+0x1c/0x30
    Oct 20 08:46:27 localhost kernel: [ 1452.045524] [<ffffffff81016565>] do_softirq+0x65/0xa0
    Oct 20 08:46:27 localhost kernel: [ 1452.045529] [<ffffffff8105a916>] irq_exit+0x96/0xc0
    Oct 20 08:46:27 localhost kernel: [ 1452.045534] [<ffffffff8148b49e>] smp_apic_timer_interrupt+0x6e/0x99
    Oct 20 08:46:27 localhost kernel: [ 1452.045538] [<ffffffff8148a20a>] apic_timer_interrupt+0x6a/0x70
    Oct 20 08:46:27 localhost kernel: [ 1452.045540] <EOI> [<ffffffffa017030c>] ? acpi_idle_enter_bm+0x287/0x2cb [processor]
    Oct 20 08:46:27 localhost kernel: [ 1452.045557] [<ffffffffa0170305>] ? acpi_idle_enter_bm+0x280/0x2cb [processor]
    Oct 20 08:46:27 localhost kernel: [ 1452.045564] [<ffffffff81355549>] cpuidle_enter+0x19/0x20
    Oct 20 08:46:27 localhost kernel: [ 1452.045568] [<ffffffff81355b96>] cpuidle_idle_call+0xa6/0x330
    Oct 20 08:46:27 localhost kernel: [ 1452.045572] [<ffffffff8101decf>] cpu_idle+0xbf/0x130
    Oct 20 08:46:27 localhost kernel: [ 1452.045578] [<ffffffff8147070d>] start_secondary+0x203/0x20a
    Oct 20 08:46:27 localhost kernel: [ 1452.045582] ---[ end trace 3f6ee7966c4895b9 ]---
    Oct 20 08:46:28 localhost dhcpcd[1626]: wlan0: carrier lost
    Oct 20 08:46:28 localhost avahi-daemon[537]: Withdrawing address record for 192.168.0.3 on wlan0.
    Oct 20 08:46:28 localhost kernel: [ 1453.106041] ieee80211 phy0: >Hardware restart was requested
    Oct 20 08:46:28 localhost kernel: [ 1453.106046] ------------[ cut here ]------------
    Oct 20 08:46:28 localhost kernel: [ 1453.106066] WARNING: at drivers/net/wireless/iwlwifi/iwl-trans.h:565 iwlagn_mac_flush+0x1a3/0x1b0 [iwlwifi]()
    Oct 20 08:46:28 localhost kernel: [ 1453.106068] Hardware name: 2306CTO
    Oct 20 08:46:28 localhost kernel: [ 1453.106071] iwl_trans_wait_tx_queue_empty bad state = 0
    Oct 20 08:46:28 localhost kernel: [ 1453.106073] Modules linked in: sha1_ssse3 s
    Last edited by bassu (2012-10-20 18:17:46)

  • Laptop-mode: shutdown problem

    I have HP Elitebook 8540W.
    When I enable the laptop-mode on this computer, I can't shutdown it anymore.
    When I shutdown my PC, everything goes well until it reaches "Remounting root filesystem readonly":
    Remounting root filesystem readonly
    >POWER OFF
    [137.532383] ata2.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x6 frozen
    [137.532529] ata2.00: cmd a0/00:00:00:08:00/00:00:00:00:00/a0 tag 0 pio 16392
    [137.532531] res 40/00:02:00:00:02/00:00:00:00:00/00 Emask 0x4 (timeout)
    [137.532813] ata2.00: status: {DRDY}
    [142.849448] ata2.00: revalidation failed (errno=-5)
    After this I have to shutdown my PC manually by pressing the power button for 5 seconds.
    The ata2 in the logging above points to my BD-ROM drive (BC-5501H).
    When I disable laptop-mode in rc.conf, the problem is gone.
    Are there any "powersave options" I can disable for my BD-ROM somewhere in laptop-mode ?

    As I understood my problem was caused by Wake-on-LAN function. You can disable it in BIOS if you don't need it.
    Also if you don't realy need ethernet connection you can remove eth0 from ethernet interface in wicd options, so wicd won't touch it anymore.
    These solutions worked for me as well as one mentioned above, but now I just removed laptop-mode and using pm-utils powersave script. More information on
    https://bbs.archlinux.org/viewtopic.php?id=134109
    http://crunchbanglinux.org/forums/topic/11954
    Battery life is now much longer than with laptop-mode and I didn't encounter shutdown problems yet.

  • Laptop-mode kills boot process on battery

    hej,
    when my laptop (acer tm 4502lci) is on battery it fails to boot because of laptop-mode.
    the boot process simply stops while indicating that laptop-mode is busy.
    when on AC this problem does not occur.
    any idea why that is?
    thanks

    yes i can, but which is the file of interest?

  • Due to my laptop screen failing i have to return to facory settings, can i reinstall adobe reader and adobe air afterwards?

    Due to my laptop screen failing I have to return it to factory settings, can I reinstall adobe reader and air afterwards?

    I don't see why not. Do you foresee a special difficulty?

  • Laptop-mode-tools no longer adjusts LCD brightness

    I just discovered that laptop-mode-tools no longer adjusts the brightness of the LCD when switched to battery. This is not a general issue. laptop-mode is active on battery (as well as being enabled via the systemd service), the computer knows it is on battery (checking with on_ac_power and reading from /sys/class/power_supply/*/* give the expected results) and other things are correctly adjusted e.g. bluetooth is blocked with rfkill. Moreover, as root I can adjust the brightness in the usual way by hand:
    echo 10 >| /sys/class/backlight/acpi_video0/brightness
    works just fine. The >| is needed because for interactive shell's, root's .bashrc sets noclobber. This obviously doesn't affect laptop-mode tools because it doesn't run an interactive shell. In contrast:
    $ cat /etc/laptop-mode/conf.d/lcd-brightness.conf | grep -v "^#"
    DEBUG=1
    CONTROL_BRIGHTNESS=1
    BATT_BRIGHTNESS_COMMAND="echo 7"
    LM_AC_BRIGHTNESS_COMMAND="echo 10"
    NOLM_AC_BRIGHTNESS_COMMAND="echo 12"
    BRIGHTNESS_OUTPUT="/sys/class/backlight/acpi_video0/brightness"
    DEBUG wasn't 1 when the problem started. I tried setting it to get more info but haven't found anything more in the journal/logs.
    KDE is set to not touch the default brightness at all. All it does is (further) dim the display after so many minutes depending on the power supply and status.
    This did work fine but I haven't been on battery for a while so I'm not sure when exactly it stopped working. My brightness is set by default to 12 on boot or wake from sleep which suggests laptop-mode tools does something or something else is now handling this which I'm not aware of. But the switch to battery does not trigger any alteration in the brightness and laptop-mode status does not even mention LCD brightness as one of the things laptop-mode tools controls.
    Have I missed a change in how this is handled somewhere?

    I doubt this is related but it is currently my only lead so here goes. I set the LCD brightness control for debug so I've been trying to watch it. However, so far it is all smiles e.g. on boot it all works fine and says so.
    However, I found I'm getting another error on boot which is
    /usr/share/laptop-mode-tools/modules/pcie-aspm: line 10: write error: Operation not permitted
    Note that I copied that by eye from VT1 so if a colon is out of place, that's why.
    The contents of that file is:
    #! /bin/sh
    # Laptop mode tools module: PCIe Active State Power Management
    if [ x$CONTROL_PCIE_ASPM = x1 ] || [ x$ENABLE_AUTO_MODULES = x1 -a x$CONTROL_PCIE_ASPM = xauto ]; then
    if [ $ON_AC -eq 1 ]; then
    log "VERBOSE" "On AC power: setting pcie_aspm to default"
    if [ -f /sys/module/pcie_aspm/parameters/policy ]; then
    echo default > /sys/module/pcie_aspm/parameters/policy
    if [ $? -eq 0 ]; then
    log "VERBOSE" "PCIe ASPM set to 'default'"
    else
    log "VERBOSE" "PCIe ASPM tweaking is prohibited by the kernel"
    fi
    else
    log "VERBOSE" "PCIe ASPM is not available"
    fi
    else
    log "VERBOSE" "On battery: setting pcie_aspm to powersave"
    if [ -f /sys/module/pcie_aspm/parameters/policy ]; then
    echo powersave > /sys/module/pcie_aspm/parameters/policy
    if [ $? -eq 0 ]; then
    log "VERBOSE" "PCIe ASPM set to 'powersave'"
    else
    log "VERBOSE" "PCIe ASPM tweaking is prohibited by the kernel"
    fi
    else
    log "VERBOSE" "PCIe ASPM is not available"
    fi
    fi
    else
    log "VERBOSE" "PCIe ASPM power savings module is disabled"
    fi
    So I assume it is saying it cannot write to /sys/module/pcie_aspm/parameters/policy but the permissions etc. on that, at least, don't look strange:
    l /sys/module/pcie_aspm/parameters/
    total 0
    drwxr-xr-x 2 root root 0 Gor 25 21:24 ./
    drwxr-xr-x 3 root root 0 Gor 25 21:23 ../
    -rw-r--r-- 1 root root 4.0K Gor 25 21:24 policy
    Last edited by cfr (2013-07-25 20:47:13)

Maybe you are looking for

  • Events in IS Utilities

    Hi Experts, What are events in IS Utilities?  Are Events termed as enhancemnts when it comes to IS Utilities? Please respond. thanks Dan

  • Using shift key when texting

    How do I shift my keyboard to upper case letters and items on my Samsung Intensity !!?

  • My I pad 3 will not come on no matter what I do and it was working until I plugged it into the charger.

    I've tried plugging and unplugging the charger, holding both buttons in for ten seconds. Even took it to cell phone repair and they couldn't get it to come alive. Any ideas?

  • [SOLVED] Fluxbox and gtk theme

    I have a problem with fluxbox. Some programs using gtk themes (e.g. spacefm, audacious) have ugly grayish 'redmond' look. I have tried to follow this how-to: http://wiki.fluxbox.org/index.php?title - gtk_themes and also tried to switch theme with lxa

  • Verizon does not care about its customers

    I have had verizon fios for quite a while now, the service itself is great but... I am a litle tired of the hackers, not sure if they are outside hackes or if this is an inside job.... ovh.net is constanly in my logs 94.23.4.33 94.23.42.81 and after