[solved][laptop-mode-tools] hard drive power settings not applied

I've used the laptop-mode-tools now for quite some time. However, recently the power management settings are not applied anymore. Possibly since updating to systemd...
My laptop-mode.conf looks as follows:
CONTROL_HD_POWERMGMT=1
# Power management for HD (hdparm -B values)
BATT_HD_POWERMGMT=254
LM_AC_HD_POWERMGMT=254
NOLM_AC_HD_POWERMGMT=254
However, even after doing a systemctl restart laptop-mode-tools.service I always get
$ sudo hdparm -B /dev/sda
/dev/sda:
APM_level = 96
Setting it manually works:
$ sudo hdparm -B 254 /dev/sda
/dev/sda:
setting Advanced Power Management level to 0xfe (254)
APM_level = 254
$ sudo hdparm -B /dev/sda
/dev/sda:
APM_level = 254
Of course, the settings are lost upon rebooting in this case.
Any idea where the problem could be?
Last edited by rggjan (2012-10-08 12:25:04)

I apologize if it is bad style to answer to a post marked as [solved] but:
Same problem here!
HDParm-settings are not applied on boot by LMT.
laptop-mode.conf:
# Should laptop mode tools control the hard drive power management settings?
# Set to 0 to disable
CONTROL_HD_POWERMGMT="auto"
# Power management for HD (hdparm -B values)
BATT_HD_POWERMGMT=100
LM_AC_HD_POWERMGMT=200
NOLM_AC_HD_POWERMGMT=254
# hdparm -B /dev/sda
/dev/sda:
APM_level = 96
Any ideas or solutions on this so far?
And why is this post marked as 'solved'?
edit:
1.) manual set hdparm-settings survive reboot but not suspend!
2.) no difference between CONTROL_HD_POWERMGMT="auto" or "1"
3.)
# systemctl status laptop-mode
laptop-mode.service - Laptop Mode Tools
Loaded: loaded (/usr/lib/systemd/system/laptop-mode.service; enabled)
Active: active (exited) since Do 2013-01-24 14:05:20 CET; 8min ago
Process: 664 ExecStart=/usr/sbin/laptop_mode init auto (code=exited, status=0/SUCCESS)
4.) pointed out that this seems to be a bug: https://bugs.archlinux.org/task/33262 as systemd does not restore apm values on wake up.
Last edited by renegat (2013-03-09 11:01:42)

Similar Messages

  • Laptop-mode-tools and hdparm -B settings

    Since the change to systemd (I think so), I have a problem with laptop-mode-tools and hdparm. The hdparm -B settings (settings to park the hard drive) are most of the times not applied on startup of my laptop. But: sometimes the setting in the config file of laptop-mode-tools is applied.
    These configs I have in /etc/laptop-mode/laptop-mode.conf:
    # Power management for HD (hdparm -B values)
    BATT_HD_POWERMGMT=254
    LM_AC_HD_POWERMGMT=254
    NOLM_AC_HD_POWERMGMT=254
    If I check the settings of hdparm after starting my laptop (sudo hdparm -B /dev/sda), most of the times the setting is 128. Because I am afraid that my hard drive will damage with this setting, every time I have to do 'sudo systemctl restart laptop-mode.service'. After that, the setting of hdparm -B is 254.
    Does anybody know something to solve this annoying problem? Thanks in advance!

    You could write an udev rule. That's what I did, although laptop-mode-tools was giving me the same result - I just wanted to reduce the list of services for the sake of boot speed.
    Mine looks like this:
    /etc/udev/rules.d/75-hdparm.rules
    ACTION=="add", KERNEL=="sda", ATTR{queue/rotational}=="1", RUN+="/sbin/hdparm -B 254 /dev/$kernel"
    You might have to change "sda" according to your system.
    Disclaimer (and friendly hint): I didn't come up with this by myself, I had to borrow it from somewhere on this forum.
    Edit: from here, but you can also find it there.
    Last edited by sano (2013-04-04 23:53:09)

  • [SOLVED]Laptop-mode-tools no cpu scaling

    Hi!
    After I installed laptop-mode-tools, I can't have my cpu freq scaling as I always did.
    Well, I'll explain better: without laptop-mode-tools I used to set my cpu freq via /etc/rc.local, and everything was fine.
    But now I need laptop-mode-tools and I have to say, everything works very well...But here comes the sun, uhm no, here comes the problem: when i plug in and out my ac cable, my frequency will stay at its lowest. The same thing happens after suspend... I can't understand...
    I tried with acpid, obviously, and for example, when i plug in ac power, lcd brightness changes as expected from my config files, but cpufreq will stay just as I said.
    So, here is my cpufreq-info now:
    limiti hardware: 1000 MHz - 1.67 GHz
    frequenze disponibili: 1.67 GHz, 1.33 GHz, 1000 MHz
    gestori disponibili: conservative, ondemand, userspace, powersave, performance
    gestore attuale: la frequenza deve mantenersi tra 1000 MHz e 1000 MHz.
    Il gestore "performance" può decidere quale velocità usare
    in questo intervallo.
    (it's italian sorry)
    this is /etc/laptop-mode/conf.d/cpufreq.conf
    # Configuration file for Laptop Mode Tools module cpufreq.
    # For more information, consult the laptop-mode.conf(8) manual page.
    # CPU frequency scaling and throttling
    # Laptop mode tools can automatically adjust your kernel CPU frequency
    # settings. This includes upper and lower limits and scaling governors.
    # There is also support for CPU throttling, on systems that don't support
    # frequency scaling.
    # This feature only works on 2.6 kernels.
    # IMPORTANT: In versions 1.36 and earlier, these settings were included in the
    # main laptop-mode.conf configuration file. If they are still present, they
    # overrule the settings in this file. To fix this, simply delete the settings
    # from the main config file.
    # Enable debug mode for this module
    # Set to 1 if you want to debug this module
    DEBUG=0
    # Should laptop mode tools control the CPU frequency settings?
    # Set to 0 to disable
    CONTROL_CPU_FREQUENCY=1
    # Legal values are "slowest" for the slowest speed that your
    # CPU is able to operate at, "fastest" for the fastest speed,
    # "medium" for some value in the middle, or any value listed in
    # /sys/devices/system/cpu/cpu*/cpufreq/scaling_available_frequencies.
    # The "governor" can be any governor installed on your system, this usually
    # includes "ondemand", "conservative", and "performance". The
    # "IGNORE_NICE_LOAD" setting specifies that background programs that have
    # a low priority ("nice level") should not cause the CPU frequency to
    # be increased. (You generally want this to be enabled in battery mode.)
    BATT_CPU_MAXFREQ=fastest
    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=performance
    LM_AC_CPU_IGNORE_NICE_LOAD=1
    NOLM_AC_CPU_MAXFREQ=fastest
    NOLM_AC_CPU_MINFREQ=slowest
    NOLM_AC_CPU_GOVERNOR=performance
    NOLM_AC_CPU_IGNORE_NICE_LOAD=0
    # Should laptop mode tools control the CPU throttling? This is only useful
    # on processors that don't have frequency scaling.
    # (Only works when you have /proc/acpi/processor/CPU*/throttling.)
    # This is only useful on older P4 processors that do not support frequency
    # scaling. On such processors, this is the only way to reduce power consumption
    # but at the cost of higher performance penalty.
    # Enable this only if you have a processor that does not support frequency scaling
    # On most new processors, you might want to disable it.
    # Set to 0 to disable.
    CONTROL_CPU_THROTTLING=0
    # Legal values are "maximum" for the maximum (slowest) throttling level,
    # "minimum" for minimum (fastest) throttling level, "medium" for a value
    # somewhere in the middle (this is usually 50% for P4s), or any value listed
    # in /proc/acpi/processor/CPU*/throttling. Be careful when using "maximum":
    # this may be _very_ slow (in fact, with P4s it slows down the processor
    # by a factor 8).
    BATT_CPU_THROTTLING=medium
    LM_AC_CPU_THROTTLING=medium
    NOLM_AC_CPU_THROTTLING=minimum
    I'm using kernel 3.1.6 with no testing repo.
    I'm using pm-utils to suspend.
    As far as I understand, the problem is in one of the file laptop-mode installs on my hd...the only solution I found was to remove laptop-mode...but I need it because it's simple and i have no time to find something else,
    Thanks everybody!
    Bye!
    Last edited by nierro (2011-12-31 10:19:09)

    Ok, after i removed laptop-mode-tools and managed to have my cpu freq scaling,lcd brightness and eeepc she through rc.local and acpid events , i found that the real problem is located in ondemand governor: after suspend it stays at lowest freq possible.
    If i change then my governor, with for example performance, it works, but if i change again to ondemand, it stays to its lowest...any idea?
    EDIT: tried with granola and userspace governor, but nothing changes... tried on my other laptop with kernel 3.1.5-ARCH, and there everything it's ok, but i noticed i haven't acpi and acpid installed there...so may be the problem is related to them? (i use the same cpufreq driver in these laptops)
    I'll try to kick out acpi and acpid and i'll make you know what happens.
    Last edited by nierro (2011-12-31 09:04:54)

  • [Solved] Laptop Suspend puts Hard Drive into Read-Only

    My problem is that s2ram brings back X (and the virtual console, if I'm on one), but never the hard drive.
    s2ram -f -a 1 suspends just like s2ram -f. -a 2 and 3 just make a high pitched sound.
    I tried both http://wiki.archlinux.org/index.php/Suspend_to_RAM and http://wiki.archlinux.org/index.php/Pm-utils methods.
    I updated my BIOS drivers but that didn't help
    s2disk works perfectly.
    This is a COMPAQ Presario CQ60-215DX
    Here is my log of the trouble during resume:
    ata4: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
    ata3: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
    sd 3:0:0:0: [sda] Starting disk
    ata4.00: qc timeout (cmd 0xec)
    ata4.00: failed to IDENTIFY (I/O error, err_mask=0x4)
    ata4.00: revalidation failed (errno=-5)
    ata3.00: qc timeout (cmd 0xa1)
    ata3.00: failed to IDENTIFY (I/O error, err_mask=0x4)
    ata3.00: revalidation failed (errno=-5)
    ata3: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
    ata4: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
    ata3.00: qc timeout (cmd 0xa1)
    ata3.00: failed to IDENTIFY (I/O error, err_mask=0x4)
    ata3.00: revalidation failed (errno=-5)
    ata3: limiting SATA link speed to 1.5 Gbps
    ata4.00: qc timeout (cmd 0xec)
    ata4.00: failed to IDENTIFY (I/O error, err_mask=0x4)
    ata4.00: revalidation failed (errno=-5)
    ata4: limiting SATA link speed to 1.5 Gbps
    ata3: SATA link up 1.5 Gbps (SStatus 113 SControl 310)
    ata4: SATA link up <unknown> (SStatus 103 SControl 310)
    And my full log:
    Linux version 2.6.30-ARCH (root@T-POWA-LX) (gcc version 4.4.1 (GCC) ) #1 SMP PREEMPT Fri Jul 31 07:30:28 CEST 2009
    Command line: root=/dev/disk/by-uuid/9ae7dfa5-74b2-41e2-89bc-b344bbf47109 ro
    KERNEL supported cpus:
    Intel GenuineIntel
    AMD AuthenticAMD
    Centaur CentaurHauls
    libata version 3.00 loaded.
    pata_amd 0000:00:06.0: version 0.4.1
    pata_amd 0000:00:06.0: setting latency timer to 64
    scsi0 : pata_amd
    scsi1 : pata_amd
    ata1: PATA max UDMA/133 cmd 0x1f0 ctl 0x3f6 bmdma 0x30c0 irq 14
    ata2: PATA max UDMA/133 cmd 0x170 ctl 0x376 bmdma 0x30c8 irq 15
    ahci 0000:00:09.0: version 3.0
    ACPI: PCI Interrupt Link [LSI0] enabled at IRQ 22
    ahci 0000:00:09.0: PCI INT A -> Link[LSI0] -> GSI 22 (level, low) -> IRQ 22
    ahci 0000:00:09.0: irq 25 for MSI/MSI-X
    ahci 0000:00:09.0: AHCI 0001.0200 32 slots 2 ports 3 Gbps 0x3 impl IDE mode
    ahci 0000:00:09.0: flags: 64bit ncq sntf led clo pmp pio slum part
    ahci 0000:00:09.0: setting latency timer to 64
    scsi2 : ahci
    scsi3 : ahci
    ata3: SATA max UDMA/133 abar m8192@0xc0004000 port 0xc0004100 irq 25
    ata4: SATA max UDMA/133 abar m8192@0xc0004000 port 0xc0004180 irq 25
    ata2: port disabled. ignoring.
    Clocksource tsc unstable (delta = 4397486409693 ns)
    ata3: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
    ata4: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
    ata4.00: ATA-8: TOSHIBA MK2555GSX, FG002C, max UDMA/100
    ata4.00: 488397168 sectors, multi 16: LBA48 NCQ (depth 31/32)
    ata4.00: configured for UDMA/100
    ata3.00: ATAPI: Optiarc DVD RW AD-7580S, FH03, max UDMA/100
    ata3.00: configured for UDMA/100
    scsi 2:0:0:0: CD-ROM Optiarc DVD RW AD-7580S FH03 PQ: 0 ANSI: 5
    scsi 3:0:0:0: Direct-Access ATA TOSHIBA MK2555GS FG00 PQ: 0 ANSI: 5
    Driver 'sr' needs updating - please use bus_type methods
    sr0: scsi3-mmc drive: 24x/24x writer dvd-ram cd/rw xa/form2 cdda tray
    Uniform CD-ROM driver Revision: 3.20
    sr 2:0:0:0: Attached scsi CD-ROM sr0
    Driver 'sd' needs updating - please use bus_type methods
    sd 3:0:0:0: [sda] 488397168 512-byte hardware sectors: (250 GB/232 GiB)
    sd 3:0:0:0: [sda] Write Protect is off
    sd 3:0:0:0: [sda] Mode Sense: 00 3a 00 00
    sd 3:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
    sda: sda1 sda2 sda3 < sda5 > sda4
    sd 3:0:0:0: [sda] Attached SCSI disk
    EXT4-fs: INFO: recovery required on readonly filesystem.
    EXT4-fs: write access will be enabled during recovery.
    EXT4-fs: barriers enabled
    kjournald2 starting: pid 569, dev sda2:8, commit interval 5 seconds
    EXT4-fs: delayed allocation enabled
    EXT4-fs: file extents enabled
    EXT4-fs: mballoc enabled
    EXT4-fs: sda2: orphan cleanup on readonly fs
    ext4_orphan_cleanup: deleting unreferenced inode 148384
    ext4_orphan_cleanup: deleting unreferenced inode 147907
    ext4_orphan_cleanup: deleting unreferenced inode 147903
    EXT4-fs: sda2: 3 orphan inodes deleted
    EXT4-fs: recovery complete.
    EXT4-fs: mounted filesystem sda2 with ordered data mode
    rtc_cmos 00:06: RTC can wake from S4
    rtc_cmos 00:06: rtc core: registered rtc_cmos as rtc0
    rtc0: alarms up to one year, y3k, 114 bytes nvram, hpet irqs
    udev: starting version 141
    pci_hotplug: PCI Hot Plug PCI Core version: 0.5
    shpchp: Standard Hot Plug PCI Controller Driver version: 0.4
    usbcore: registered new interface driver usbfs
    usbcore: registered new interface driver hub
    ACPI: AC Adapter [ADP1] (on-line)
    forcedeth: Reverse Engineered nForce ethernet driver. Version 0.64.
    ACPI: PCI Interrupt Link [LMAC] enabled at IRQ 21
    forcedeth 0000:00:0a.0: PCI INT A -> Link[LMAC] -> GSI 21 (level, low) -> IRQ 21
    forcedeth 0000:00:0a.0: setting latency timer to 64
    sr 2:0:0:0: Attached scsi generic sg0 type 5
    sd 3:0:0:0: Attached scsi generic sg1 type 0
    usbcore: registered new device driver usb
    ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
    ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
    cfg80211: Calling CRDA to update world regulatory domain
    input: Power Button as /devices/LNXSYSTM:00/LNXPWRBN:00/input/input2
    ACPI: Power Button [PWRF]
    input: Lid Switch as /devices/LNXSYSTM:00/device:00/PNP0C0D:00/input/input3
    ACPI: Lid Switch [LID0]
    input: Sleep Button as /devices/LNXSYSTM:00/device:00/PNP0C0E:00/input/input4
    ACPI: Sleep Button [SLPB]
    input: Power Button as /devices/LNXSYSTM:00/device:00/PNP0C0C:00/input/input5
    ACPI: Power Button [PWRB]
    processor ACPI_CPU:00: registered as cooling_device0
    processor ACPI_CPU:01: registered as cooling_device1
    forcedeth 0000:00:0a.0: ifname eth0, PHY OUI 0x732 @ 1, addr 00:1f:16:74:cb:72
    forcedeth 0000:00:0a.0: highdma csum pwrctl mgmt lnktim msi desc-v3
    ACPI: PCI Interrupt Link [LUS2] enabled at IRQ 17
    ehci_hcd 0000:00:02.1: PCI INT B -> Link[LUS2] -> GSI 17 (level, low) -> IRQ 17
    ehci_hcd 0000:00:02.1: setting latency timer to 64
    ehci_hcd 0000:00:02.1: EHCI Host Controller
    ehci_hcd 0000:00:02.1: new USB bus registered, assigned bus number 1
    ehci_hcd 0000:00:02.1: debug port 1
    ehci_hcd 0000:00:02.1: cache line size of 64 is not supported
    ehci_hcd 0000:00:02.1: irq 17, io mem 0xc0007000
    ACPI: WMI: Mapper loaded
    ehci_hcd 0000:00:02.1: USB 2.0 started, EHCI 1.00
    usb usb1: configuration #1 chosen from 1 choice
    hub 1-0:1.0: USB hub found
    hub 1-0:1.0: 3 ports detected
    i2c-adapter i2c-0: nForce2 SMBus adapter at 0x3040
    i2c-adapter i2c-1: nForce2 SMBus adapter at 0x3000
    ACPI: PCI Interrupt Link [LUS0] enabled at IRQ 17
    ohci_hcd 0000:00:02.0: PCI INT A -> Link[LUS0] -> GSI 17 (level, low) -> IRQ 17
    ohci_hcd 0000:00:02.0: setting latency timer to 64
    ohci_hcd 0000:00:02.0: OHCI Host Controller
    ohci_hcd 0000:00:02.0: new USB bus registered, assigned bus number 2
    ohci_hcd 0000:00:02.0: irq 17, io mem 0xc0006000
    usb usb2: configuration #1 chosen from 1 choice
    hub 2-0:1.0: USB hub found
    hub 2-0:1.0: 3 ports detected
    ACPI: PCI Interrupt Link [Z011] enabled at IRQ 16
    ehci_hcd 0000:00:04.1: PCI INT B -> Link[Z011] -> GSI 16 (level, low) -> IRQ 16
    ehci_hcd 0000:00:04.1: setting latency timer to 64
    ehci_hcd 0000:00:04.1: EHCI Host Controller
    ehci_hcd 0000:00:04.1: new USB bus registered, assigned bus number 3
    ehci_hcd 0000:00:04.1: debug port 1
    ehci_hcd 0000:00:04.1: cache line size of 64 is not supported
    ehci_hcd 0000:00:04.1: irq 16, io mem 0xc0007400
    ehci_hcd 0000:00:04.1: USB 2.0 started, EHCI 1.00
    usb usb3: configuration #1 chosen from 1 choice
    hub 3-0:1.0: USB hub found
    hub 3-0:1.0: 4 ports detected
    ACPI: PCI Interrupt Link [Z010] enabled at IRQ 16
    ohci_hcd 0000:00:04.0: PCI INT A -> Link[Z010] -> GSI 16 (level, low) -> IRQ 16
    ohci_hcd 0000:00:04.0: setting latency timer to 64
    ohci_hcd 0000:00:04.0: OHCI Host Controller
    ohci_hcd 0000:00:04.0: new USB bus registered, assigned bus number 4
    ohci_hcd 0000:00:04.0: irq 16, io mem 0xc0008000
    usb usb4: configuration #1 chosen from 1 choice
    hub 4-0:1.0: USB hub found
    hub 4-0:1.0: 4 ports detected
    thermal LNXTHERM:01: registered as thermal_zone0
    ACPI: Thermal Zone [TZS0] (68 C)
    ACPI: Battery Slot [BAT0] (battery present)
    thermal LNXTHERM:02: registered as thermal_zone1
    ACPI: Thermal Zone [TZS1] (68 C)
    usb 1-1: new high speed USB device using ehci_hcd and address 2
    nvidia: module license 'NVIDIA' taints kernel.
    Disabling lock debugging due to kernel taint
    usb 1-1: configuration #1 chosen from 1 choice
    Synaptics Touchpad, model: 1, fw: 7.0, id: 0x1a0b1, caps: 0xd04711/0xa00000
    acpi device:13: registered as cooling_device2
    input: Video Bus as /devices/LNXSYSTM:00/device:00/PNP0A08:00/device:10/device:11/input/input6
    ACPI: Video Device [VGA] (multi-head: yes rom: no post: no)
    usb 3-4: new high speed USB device using ehci_hcd and address 2
    input: SynPS/2 Synaptics TouchPad as /devices/platform/i8042/serio2/input/input7
    ath5k 0000:07:00.0: PCI INT A -> Link[Z012] -> GSI 23 (level, low) -> IRQ 23
    ath5k 0000:07:00.0: setting latency timer to 64
    ath5k 0000:07:00.0: registered as 'phy0'
    usb 3-4: configuration #1 chosen from 1 choice
    ACPI: PCI Interrupt Link [LGPU] enabled at IRQ 20
    nvidia 0000:02:00.0: PCI INT A -> Link[LGPU] -> GSI 20 (level, low) -> IRQ 20
    nvidia 0000:02:00.0: setting latency timer to 64
    NVRM: loading NVIDIA UNIX x86_64 Kernel Module 185.18.31 Tue Jul 28 17:52:27 PDT 2009
    EXT4 FS on sda2, internal journal on sda2:8
    Adding 3148700k swap on /dev/sda5. Priority:-1 extents:1 across:3148700k
    scsi 4:0:0:0: Direct-Access Generic- Multi-Card 1.00 PQ: 0 ANSI: 0 CCS
    sd 4:0:0:0: Attached scsi generic sg2 type 0
    usb-storage: device scan complete
    sd 4:0:0:0: [sdb] Attached SCSI removable disk
    scsi 5:0:0:0: Direct-Access USB Driver 0.00 PQ: 0 ANSI: 0 CCS
    sd 5:0:0:0: Attached scsi generic sg3 type 0
    usb-storage: device scan complete
    sd 5:0:0:0: [sdc] 7827456 512-byte hardware sectors: (4.00 GB/3.73 GiB)
    sd 5:0:0:0: [sdc] Write Protect is off
    sd 5:0:0:0: [sdc] Mode Sense: 23 00 00 00
    sd 5:0:0:0: [sdc] Assuming drive cache: write through
    sd 5:0:0:0: [sdc] Assuming drive cache: write through
    sdc:
    sd 5:0:0:0: [sdc] Attached SCSI removable disk
    forcedeth 0000:00:0a.0: irq 26 for MSI/MSI-X
    eth0: no link during initialization.
    NET: Registered protocol family 10
    lo: Disabled Privacy Extensions
    ADDRCONF(NETDEV_UP): eth0: link is not ready
    PM: Syncing filesystems ... done.
    Freezing user space processes ... (elapsed 0.00 seconds) done.
    Freezing remaining freezable tasks ... (elapsed 0.00 seconds) done.
    Suspending console(s) (use no_console_suspend to debug)
    sd 3:0:0:0: [sda] Synchronizing SCSI cache
    sd 3:0:0:0: [sda] Stopping disk
    ath5k 0000:07:00.0: PCI INT A disabled
    forcedeth 0000:00:0a.0: wake-up capability disabled by ACPI
    forcedeth 0000:00:0a.0: PME# disabled
    forcedeth 0000:00:0a.0: PCI INT A disabled
    HDA Intel 0000:00:07.0: PCI INT A disabled
    ata2: port disabled. ignoring.
    ehci_hcd 0000:00:04.1: PCI INT B disabled
    ehci_hcd 0000:00:04.1: PME# disabled
    ohci_hcd 0000:00:04.0: PCI INT A disabled
    ohci_hcd 0000:00:04.0: PME# disabled
    ehci_hcd 0000:00:02.1: PCI INT B disabled
    ehci_hcd 0000:00:02.1: PME# disabled
    ohci_hcd 0000:00:02.0: PCI INT A disabled
    ohci_hcd 0000:00:02.0: PME# disabled
    ACPI: Preparing to enter system sleep state S3
    Disabling non-boot CPUs ...
    CPU 1 is now offline
    SMP alternatives: switching to UP code
    CPU0 attaching NULL sched-domain.
    CPU1 attaching NULL sched-domain.
    CPU0 attaching NULL sched-domain.
    CPU1 is down
    Extended CMOS year: 2000
    x86 PAT enabled: cpu 0, old 0x7040600070406, new 0x7010600070106
    Back to C!
    Extended CMOS year: 2000
    Enabling non-boot CPUs ...
    SMP alternatives: switching to SMP code
    Booting processor 1 APIC 0x1 ip 0x6000
    Initializing CPU#1
    Calibrating delay using timer specific routine.. 4001.76 BogoMIPS (lpj=6666816)
    CPU: L1 I Cache: 64K (64 bytes/line), D cache 64K (64 bytes/line)
    CPU: L2 Cache: 512K (64 bytes/line)
    CPU: Physical Processor ID: 0
    CPU: Processor Core ID: 1
    x86 PAT enabled: cpu 1, old 0x7040600070406, new 0x7010600070106
    CPU1: AMD Athlon Dual-Core QL-62 stepping 01
    CPU0 attaching NULL sched-domain.
    Switched to high resolution mode on CPU 1
    CPU0 attaching sched-domain:
    domain 0: span 0-1 level MC
    groups: 0 1
    CPU1 attaching sched-domain:
    domain 0: span 0-1 level MC
    groups: 1 0
    CPU1 is up
    ACPI: Waking up from system sleep state S3
    ohci_hcd 0000:00:02.0: restoring config space at offset 0x1 (was 0xb00007, writing 0xb00003)
    ehci_hcd 0000:00:02.1: restoring config space at offset 0x1 (was 0xb00006, writing 0xb00002)
    ohci_hcd 0000:00:04.0: restoring config space at offset 0x1 (was 0xb00007, writing 0xb00003)
    ehci_hcd 0000:00:04.1: restoring config space at offset 0x1 (was 0xb00006, writing 0xb00002)
    pata_amd 0000:00:06.0: restoring config space at offset 0x1 (was 0xb00005, writing 0xb80005)
    HDA Intel 0000:00:07.0: restoring config space at offset 0xf (was 0x5020100, writing 0x502010a)
    HDA Intel 0000:00:07.0: restoring config space at offset 0x4 (was 0x0, writing 0xc0000000)
    HDA Intel 0000:00:07.0: restoring config space at offset 0x1 (was 0xb00000, writing 0xb00002)
    ahci 0000:00:09.0: restoring config space at offset 0x1 (was 0xb00007, writing 0xb00407)
    pcieport-driver 0000:00:14.0: restoring config space at offset 0x7 (was 0x1f1, writing 0x200001f1)
    pcieport-driver 0000:00:14.0: restoring config space at offset 0x1 (was 0x100107, writing 0x1005
    nvidia 0000:02:00.0: restoring config space at offset 0xf (was 0x100, writing 0x10a)
    nvidia 0000:02:00.0: restoring config space at offset 0x9 (was 0x1, writing 0x4001)
    nvidia 0000:02:00.0: restoring config space at offset 0x7 (was 0xc, writing 0xc400000c)
    nvidia 0000:02:00.0: restoring config space at offset 0x5 (was 0xc, writing 0xd000000c)
    ath5k 0000:07:00.0: restoring config space at offset 0x3 (was 0x0, writing 0x10)
    nForce2_smbus 0000:00:01.1: PME# disabled
    ohci_hcd 0000:00:02.0: PME# disabled
    ohci_hcd 0000:00:02.0: PCI INT A -> Link[LUS0] -> GSI 17 (level, low) -> IRQ 17
    ohci_hcd 0000:00:02.0: setting latency timer to 64
    ohci_hcd 0000:00:02.0: PME# disabled
    ehci_hcd 0000:00:02.1: PME# disabled
    ehci_hcd 0000:00:02.1: PCI INT B -> Link[LUS2] -> GSI 17 (level, low) -> IRQ 17
    ehci_hcd 0000:00:02.1: setting latency timer to 64
    ehci_hcd 0000:00:02.1: PME# disabled
    usb usb1: root hub lost power or was reset
    ehci_hcd 0000:00:02.1: debug port 1
    ehci_hcd 0000:00:02.1: cache line size of 64 is not supported
    ohci_hcd 0000:00:04.0: PME# disabled
    ohci_hcd 0000:00:04.0: PCI INT A -> Link[Z010] -> GSI 16 (level, low) -> IRQ 16
    ohci_hcd 0000:00:04.0: setting latency timer to 64
    ohci_hcd 0000:00:04.0: PME# disabled
    ehci_hcd 0000:00:04.1: PME# disabled
    ehci_hcd 0000:00:04.1: PCI INT B -> Link[Z011] -> GSI 16 (level, low) -> IRQ 16
    ehci_hcd 0000:00:04.1: setting latency timer to 64
    ehci_hcd 0000:00:04.1: PME# disabled
    usb usb3: root hub lost power or was reset
    ehci_hcd 0000:00:04.1: debug port 1
    ehci_hcd 0000:00:04.1: cache line size of 64 is not supported
    pata_amd 0000:00:06.0: restoring config space at offset 0x1 (was 0xb00005, writing 0xb80005)
    pata_amd 0000:00:06.0: setting latency timer to 64
    ata2: port disabled. ignoring.
    HDA Intel 0000:00:07.0: PCI INT A -> Link[LAZA] -> GSI 19 (level, low) -> IRQ 19
    HDA Intel 0000:00:07.0: setting latency timer to 64
    pci 0000:00:08.0: setting latency timer to 64
    ahci 0000:00:09.0: setting latency timer to 64
    forcedeth 0000:00:0a.0: wake-up capability disabled by ACPI
    forcedeth 0000:00:0a.0: PME# disabled
    ata4: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
    ata3: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
    forcedeth 0000:00:0a.0: irq 26 for MSI/MSI-X
    eth0: no link during initialization.
    pci 0000:00:0b.0: setting latency timer to 64
    ath5k 0000:07:00.0: PCI INT A -> Link[Z012] -> GSI 23 (level, low) -> IRQ 23
    sd 3:0:0:0: [sda] Starting disk
    ata4.00: qc timeout (cmd 0xec)
    ata4.00: failed to IDENTIFY (I/O error, err_mask=0x4)
    ata4.00: revalidation failed (errno=-5)
    ata3.00: qc timeout (cmd 0xa1)
    ata3.00: failed to IDENTIFY (I/O error, err_mask=0x4)
    ata3.00: revalidation failed (errno=-5)
    ata3: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
    ata4: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
    ata3.00: qc timeout (cmd 0xa1)
    ata3.00: failed to IDENTIFY (I/O error, err_mask=0x4)
    ata3.00: revalidation failed (errno=-5)
    ata3: limiting SATA link speed to 1.5 Gbps
    ata4.00: qc timeout (cmd 0xec)
    ata4.00: failed to IDENTIFY (I/O error, err_mask=0x4)
    ata4.00: revalidation failed (errno=-5)
    ata4: limiting SATA link speed to 1.5 Gbps
    ata3: SATA link up 1.5 Gbps (SStatus 113 SControl 310)
    ata4: SATA link up <unknown> (SStatus 103 SControl 310)
    ata4.00: qc timeout (cmd 0xec)
    ata4.00: failed to IDENTIFY (I/O error, err_mask=0x4)
    ata4.00: revalidation failed (errno=-5)
    ata4.00: disabled
    ata3.00: qc timeout (cmd 0xa1)
    ata3.00: failed to IDENTIFY (I/O error, err_mask=0x4)
    ata3.00: revalidation failed (errno=-5)
    ata3.00: disabled
    sd 3:0:0:0: [sda] START_STOP FAILED
    sd 3:0:0:0: [sda] Result: hostbyte=0x04 driverbyte=0x00
    sd 3:0:0:0: [sda] Unhandled error code
    sd 3:0:0:0: [sda] Result: hostbyte=0x04 driverbyte=0x00
    end_request: I/O error, dev sda, sector 134590273
    Buffer I/O error on device sda2, logical block 1094141
    lost page write due to I/O error on sda2
    sd 3:0:0:0: [sda] Unhandled error code
    sd 3:0:0:0: [sda] Result: hostbyte=0x04 driverbyte=0x00
    end_request: I/O error, dev sda, sector 135807281
    Buffer I/O error on device sda2, logical block 1246267
    lost page write due to I/O error on sda2
    sd 3:0:0:0: [sda] Unhandled error code
    sd 3:0:0:0: [sda] Result: hostbyte=0x04 driverbyte=0x00
    end_request: I/O error, dev sda, sector 135815833
    Buffer I/O error on device sda2, logical block 1247336
    lost page write due to I/O error on sda2
    JBD2: Detected IO errors while flushing file data on sda2:8
    sd 3:0:0:0: [sda] Unhandled error code
    sd 3:0:0:0: [sda] Result: hostbyte=0x04 driverbyte=0x00
    end_request: I/O error, dev sda, sector 155463993
    Aborting journal on device sda2:8.
    sd 3:0:0:0: [sda] Unhandled error code
    sd 3:0:0:0: [sda] Result: hostbyte=0x04 driverbyte=0x00
    end_request: I/O error, dev sda, sector 155459417
    Buffer I/O error on device sda2, logical block 3702784
    lost page write due to I/O error on sda2
    JBD2: I/O error detected when updating journal superblock for sda2:8.
    PM: Device 3:0:0:0 failed to resume: error 262144
    usb 1-1: reset high speed USB device using ehci_hcd and address 2
    usb 3-4: reset high speed USB device using ehci_hcd and address 2
    Restarting tasks ... <2>ext4_abort called.
    EXT4-fs error (device sda2): ext4_journal_start_sb: Detected aborted journal
    Remounting filesystem read-only
    ext4_da_writepages: jbd2_start: 1024 pages, ino 131086; err -30
    Pid: 20, comm: pdflush Tainted: P 2.6.30-ARCH #1
    Call Trace:
    [<ffffffffa00d738d>] ? ext4_da_writepages+0x47d/0x4b0 [ext4]
    [<ffffffff8026c6a4>] ? bit_waitqueue+0x24/0xe0
    [<ffffffff802c8332>] ? do_writepages+0x32/0x60
    [<ffffffff80321b7a>] ? __writeback_single_inode+0xba/0x490
    [<ffffffff802406e6>] ? dequeue_task_fair+0x56/0x1d0
    [<ffffffff8020a95c>] ? __switch_to+0xdc/0x3b0
    [<ffffffff803223b3>] ? generic_sync_sb_inodes+0x193/0x530
    [<ffffffff803229c5>] ? writeback_inodes+0x65/0x120
    [<ffffffff802c85a6>] ? wb_kupdate+0xc6/0x160
    [<ffffffff802c995b>] ? pdflush+0x16b/0x2a0
    [<ffffffff802c84e0>] ? wb_kupdate+0x0/0x160
    [<ffffffff802c97f0>] ? pdflush+0x0/0x2a0
    [<ffffffff802c97f0>] ? pdflush+0x0/0x2a0
    [<ffffffff8026c204>] ? kthread+0x64/0xc0
    [<ffffffff8024af20>] ? schedule_tail+0x30/0x80
    [<ffffffff8020d4fa>] ? child_rip+0xa/0x20
    [<ffffffff8026c1a0>] ? kthread+0x0/0xc0
    [<ffffffff8020d4f0>] ? child_rip+0x0/0x20
    sd 3:0:0:0: [sda] Unhandled error code
    sd 3:0:0:0: [sda] Result: hostbyte=0x04 driverbyte=0x00
    end_request: I/O error, dev sda, sector 126637417
    sd 3:0:0:0: [sda] Unhandled error code
    sd 3:0:0:0: [sda] Result: hostbyte=0x04 driverbyte=0x00
    end_request: I/O error, dev sda, sector 126637417
    sd 3:0:0:0: [sda] Unhandled error code
    sd 3:0:0:0: [sda] Result: hostbyte=0x04 driverbyte=0x00
    end_request: I/O error, dev sda, sector 126637417
    sd 3:0:0:0: [sda] Unhandled error code
    sd 3:0:0:0: [sda] Result: hostbyte=0x04 driverbyte=0x00
    end_request: I/O error, dev sda, sector 126637417
    sd 3:0:0:0: [sda] Unhandled error code
    sd 3:0:0:0: [sda] Result: hostbyte=0x04 driverbyte=0x00
    end_request: I/O error, dev sda, sector 126637417
    done.
    sd 3:0:0:0: [sda] Unhandled error code
    sd 3:0:0:0: [sda] Result: hostbyte=0x04 driverbyte=0x00
    end_request: I/O error, dev sda, sector 130097993
    EXT4-fs error (device sda2): ext4_find_entry: reading directory #139292 offset 0
    sd 3:0:0:0: [sda] Unhandled error code
    sd 3:0:0:0: [sda] Result: hostbyte=0x04 driverbyte=0x00
    end_request: I/O error, dev sda, sector 126637417
    sd 3:0:0:0: [sda] Unhandled error code
    sd 3:0:0:0: [sda] Result: hostbyte=0x04 driverbyte=0x00
    end_request: I/O error, dev sda, sector 126004889
    EXT4-fs error (device sda2): ext4_find_entry: reading directory #98457 offset 0
    sd 3:0:0:0: [sda] Unhandled error code
    sd 3:0:0:0: [sda] Result: hostbyte=0x04 driverbyte=0x00
    end_request: I/O error, dev sda, sector 126004889
    EXT4-fs error (device sda2): ext4_find_entry: reading directory #98457 offset 0
    ANY help would be much appreciated.
    Last edited by Cappy (2009-08-10 08:19:09)

    Nevermind .. *sigh* ... pci=msi on the kernel fixed it .. going to go cut myself now ...

  • Power management: laptop-mode-tools and pm-utils confusion

    There have been a few threads recently that touch on this topic, but I'm still somewhat confused as to how best to use these two tools for power management.
    As I understand it, laptop-mode-tools is a set of scripts and config files for controlling various aspects of power saving, while pm-utils started as a tool for managing suspend/hibernate.  However, newer versions of pm-utils have begun to include general power management features that conflict with those of laptop-mode-tools, and respond to the pm-powersave command.
    Ideally, I would like to control power management in the following way: Have acpid as the only running daemon (rather than acpid and laptop-mode-tools as I have now), which then calls pm-suspend, pm-hibernate and pm-powersave in the appropriate circumstances. 
    The wiki has a brief guide on how to insert pm-powersave as an acpi event; however, it seems to me that pm-utils is not able to replicate all the functions of laptop-mode-tools yet, for example in controlling the eeepc's SHE.
    In this thread: https://bbs.archlinux.org/viewtopic.php?pid=784969, einhard seems to suggest that its quite a simple process to modify some hooks from laptop-mode-tools to make them work with pm-utils.  I would be eternally grateful if somebody could post an example of how to carry out this modification.  I have very minimal knowledge of bash, which means that I can't get going on my own but I think I could modify the rest of the hooks on my own if I had an example, a template, to guide me. 
    Of course if anyone has any other suggestions regarding how best to mix these tools for power management it would be very good to hear them.  I am aware of this thread: https://bbs.archlinux.org/viewtopic.php?id=88011&p=2, in which takedown suggests writing some dummy hooks to pm-utils to prevent any conflict, but I'm not entirely clear about which hooks I should apply this to, i. e. just the hooks in power.d or those in sleep.d, too?

    mordoc, what exactly is the problem your having?
    Since I made the original post I have actually succeeded in creating the setup I described, i.e. I have removed laptop-mode-tools and have pm-utils do all suspend, hibernate and power management functions using acpid.  This required adding a very simple custom hook to pm-powersave to deal with all the power-saving functions of laptop-mode-tools that pm-powersave does not (yet) replace OOTB.

  • Laptop-mode-tools/cpufrequtils Questions [SOLVED]

    I am running a Sony Vaio VGN-FW480J and am trying to optimize these two tools to save battery life and hard drive life span.   I have added @laptop-mode to my daemon array and acpi-cpufreq to modules. A few issues I immediately notice:
    1) cpufreq doesn't revert back to higher frequencies if I unplug and plug power source back in (before unplugging: CPU 0 - 800 MHz, CPU 1 - 2.00 GHz; after both are 800 and won't change if I plug power source back in)
    2) I believe the hard disk is actually spinning down more frequently (and fan is almost always on, even when no work is being done).  Here are the relevant files/the ones that I have altered.
    laptop-mode.conf
    # Configuration for Laptop Mode Tools
    # There is a "system" to the configuration setting names:
    # CONTROL_something=0/1 Determines whether Laptop Mode Tools controls
    # something
    # LM_something=value Value of "something" when laptop mode is active
    # NOLM_something=value Value of "something" when laptop mode is NOT
    # active
    # AC_something=value Value of "something" when the computer is running
    # on AC power
    # BATT_something=value Value of "something when the computer is running
    # on battery power
    # There can be combinations of LM_/NOLM_ and AC_/BATT_ prefixes, but the
    # available prefixes are different for each setting. The available ones are
    # documented in the manual page, laptop-mode.conf(8). If there is no LM_/
    # NOLM_ in a setting name, then the value is used independently of laptop
    # mode state, and similarly, if there is no AC_/BATT_, then the value is used
    # independently of power state.
    # Some options only work on ACPI systems. They are marked ACPI-ONLY.
    # Note that this configuration file is a fragment of shell script: you
    # can use all the features of the shell scripting language to achieve your
    # desired configuration.
    # Modules
    # Laptop Mode Tools modules have separate configuration files, that can be
    # found in /etc/laptop-mode/conf.d. Please look through these configuration
    # files as well, there are many useful power saving tools in there!
    # Enable/Disable laptop-mode-tools execution
    # Set it to 0 to completely disable laptop-mode-tools from running
    ENABLE_LAPTOP_MODE_TOOLS=1
    # Configuration debugging
    # Set this to 1 if you want to see a lot of information when you start/stop
    # laptop_mode.
    VERBOSE_OUTPUT=0
    # Set this to 1 if you want to log messages to syslog
    LOG_TO_SYSLOG=1
    # Run in shell debug mode
    # Enable this if you would like to execute the entire laptop-mode-tools program
    # in shell debug mode. Warning: This will create a lot of text output
    # If you are debugging an individual module, perhaps you would want to enable
    # each module specific debug mode (available in module conf files)
    DEBUG=0
    # When to enable laptop mode
    # "Laptop mode" is the mode in which laptop mode tools makes the computer
    # consume less power. This includes the kernel "laptop_mode" feature, which
    # allows your hard drives to spin down, as well as various other settings which
    # can be tweaked by laptop mode tools. You can enable or disable all of these
    # settings using the CONTROL_... options further down in this config file.
    # Enable laptop mode when on battery power.
    ENABLE_LAPTOP_MODE_ON_BATTERY=1
    # Enable laptop mode when on AC power.
    ENABLE_LAPTOP_MODE_ON_AC=1
    # Enable laptop mode when the laptop's lid is closed, even when we're on AC
    # power? (ACPI-ONLY)
    ENABLE_LAPTOP_MODE_WHEN_LID_CLOSED=0
    # Enable all simple zero-configuration auto modules
    # This option enables all simple modules (listed below) without requiring
    # the user to enable each module individually
    # List of modules which can be automatically enabled with this setting are:
    # ac97-powersave
    # cpufreq
    # dpms-standby
    # eee-superhe
    # ethernet
    # exec-commands
    # hal-polling
    # hdparm
    # intel-hda-powersave
    # intel-sata-powermgmt
    # runtime-pm
    # sched-mc-power-savings
    # sched-smt-power-savings
    # terminal-blanking
    # usb-autosuspend
    # wireless-ipw-power
    # wireless-iwl-power
    # wireless-power
    # Set this to 1 to enable all simple zero-configuration auto modules listed above.
    # NOTE: You can explicitly enable/disable any of the above modules by changing their
    # values in the individual settings file
    ENABLE_AUTO_MODULES=1
    # When to enable data loss sensitive features
    # When data loss sensitive features are disabled, laptop mode tools acts as if
    # laptop mode were disabled, for those features only.
    # Data loss sensitive features include:
    # - laptop_mode (i.e., delayed writes)
    # - hard drive write cache
    # All of the options that follow can be set to 0 in order to prevent laptop
    # mode tools from using them to stop data loss sensitive features. Use this
    # when you have a battery that reports the wrong information, that confuses
    # laptop mode tools.
    # Disabling data loss sensitive features is ACPI-ONLY, and it only works if
    # your battery gives off frequent ACPI events to indicate a change in battery
    # level.
    # NOTE: If your battery does NOT give off battery events often enough, you can
    # enable the battery-level-polling module to make this work. Look at the
    # file /etc/laptop-mode/conf.d/battery-level-polling.conf for more information.
    # Disable all data loss sensitive features when the battery level (in % of the
    # battery capacity) reaches this value.
    MINIMUM_BATTERY_CHARGE_PERCENT=3
    # Disable data loss sensitive features when the battery reports its state
    # as "critical".
    DISABLE_LAPTOP_MODE_ON_CRITICAL_BATTERY_LEVEL=1
    # Controlled hard drives and partitions
    # For spinning down your hard drives, laptop mode will remount file systems and
    # adjust hard drive spindown timeouts. These parameters specify which
    # devices and partitions are affected by laptop mode.
    # The drives that laptop mode controls.
    # Separate them by a space, e.g. HD="/dev/hda /dev/hdb". The default is a
    # wildcard, which will get you all your IDE and SCSI/SATA drives.
    HD="/dev/[hs]d[abcdefgh]"
    # The partitions (or mount points) that laptop mode controls.
    # Separate the values by spaces. Use "auto" to indicate all partitions on drives
    # listed in HD. You can add things to "auto", e.g. "auto /dev/hdc3". You can
    # also specify mount points, e.g. "/mnt/data".
    PARTITIONS="auto /dev/mapper/*"
    # If this is enabled, laptop mode tools will assume that SCSI drives are
    # really SATA drives that only _look_ like SCSI drives, and will use hdparm
    # to control them. Set this to 0 if you have /dev/sd devices and you want
    # laptop mode tools to use the "sdparm" command to control them.
    ASSUME_SCSI_IS_SATA=1
    # Hard drive behaviour settings
    # These settings specify how laptop mode tools will adjust the various
    # parameters of your hard drives and file systems.
    # Maximum time, in seconds, of work that you are prepared to lose when your
    # system crashes or power runs out. This is the maximum time that Laptop Mode
    # will keep unsaved data waiting in memory before spinning up your hard drive.
    LM_BATT_MAX_LOST_WORK_SECONDS=600
    LM_AC_MAX_LOST_WORK_SECONDS=360
    # Should laptop mode tools control readahead?
    CONTROL_READAHEAD=1
    # Read-ahead, in kilobytes. You can spin down the disk while playing MP3/OGG
    # by setting the disk readahead to a reasonable size, e.g. 3072 (3 MB).
    # Effectively, the disk will read a complete MP3 at once, and will then spin
    # down while the MP3/OGG is playing. Don't set this too high, because the
    # readahead is applied to _all_ files that are read from disk.
    LM_READAHEAD=3072
    NOLM_READAHEAD=128
    # Should laptop mode tools add the "noatime" option to the mount options when
    # laptop mode is enabled?
    CONTROL_NOATIME=0
    # Should laptop use relatime instead of noatime? The "relatime" mount option has
    # more standards-compliant semantics, and allows more applications to work,
    # while retaining a low level of atime updates (i.e., disk writes).
    USE_RELATIME=0
    # Should laptop mode tools control the hard drive idle timeout settings?
    CONTROL_HD_IDLE_TIMEOUT=1
    # Idle timeout values. (hdparm -S)
    # Default is 2 hours on AC (NOLM_HD_IDLE_TIMEOUT_SECONDS=7200) and 20 seconds
    # for battery and for AC with laptop mode on.
    LM_AC_HD_IDLE_TIMEOUT_SECONDS=20
    LM_BATT_HD_IDLE_TIMEOUT_SECONDS=20
    NOLM_HD_IDLE_TIMEOUT_SECONDS=7200
    # Should laptop mode tools control the hard drive power management settings?
    # Set to 0 to disable
    CONTROL_HD_POWERMGMT="auto"
    # Power management for HD (hdparm -B values)
    BATT_HD_POWERMGMT=128
    LM_AC_HD_POWERMGMT=254
    NOLM_AC_HD_POWERMGMT=254
    # Should laptop mode tools control the hard drive write cache settings?
    CONTROL_HD_WRITECACHE=0
    # Write cache settings for HD (hdparm -W values)
    NOLM_AC_HD_WRITECACHE=1
    NOLM_BATT_HD_WRITECACHE=0
    LM_HD_WRITECACHE=0
    # Settings you probably don't want to touch
    # It is usually not necessary to change these parameters. They are included
    # for completeness' sake.
    # Change mount options on partitions in PARTITIONS? You don't really want to
    # disable this. If you do, then your hard drives will probably not spin down
    # anymore.
    CONTROL_MOUNT_OPTIONS=1
    # Dirty synchronous ratio. At this percentage of dirty pages the process
    # which calls write() does its own writeback.
    LM_DIRTY_RATIO=60
    NOLM_DIRTY_RATIO=40
    # Allowed dirty background ratio, in percent. Once DIRTY_RATIO has been
    # exceeded, the kernel will wake pdflush which will then reduce the amount
    # of dirty memory to dirty_background_ratio. Set this nice and low, so once
    # some writeout has commenced, we do a lot of it.
    LM_DIRTY_BACKGROUND_RATIO=1
    NOLM_DIRTY_BACKGROUND_RATIO=10
    # kernel default settings -- don't touch these unless you know what you're
    # doing.
    DEF_UPDATE=5
    DEF_XFS_AGE_BUFFER=15
    DEF_XFS_SYNC_INTERVAL=30
    DEF_XFS_BUFD_INTERVAL=1
    DEF_MAX_AGE=30
    # This must be adjusted manually to the value of HZ in the running kernel
    # on 2.4, until the XFS people change their 2.4 external interfaces to work in
    # centisecs. This can be automated, but it's a work in progress that still
    # needs some fixes. On 2.6 kernels, XFS uses USER_HZ instead of HZ for
    # external interfaces, and that is currently always set to 100. So you don't
    # need to change this on 2.6.
    XFS_HZ=100
    # Seconds laptop mode has to to wait after the disk goes idle before doing
    # a sync.
    LM_SECONDS_BEFORE_SYNC=2
    cpufreq.conf
    # Configuration file for Laptop Mode Tools module cpufreq.
    # For more information, consult the laptop-mode.conf(8) manual page.
    # CPU frequency scaling and throttling
    # Laptop mode tools can automatically adjust your kernel CPU frequency
    # settings. This includes upper and lower limits and scaling governors.
    # There is also support for CPU throttling, on systems that don't support
    # frequency scaling.
    # This feature only works on 2.6 kernels.
    # IMPORTANT: In versions 1.36 and earlier, these settings were included in the
    # main laptop-mode.conf configuration file. If they are still present, they
    # overrule the settings in this file. To fix this, simply delete the settings
    # from the main config file.
    # Enable debug mode for this module
    # Set to 1 if you want to debug this module
    DEBUG=0
    # Should laptop mode tools control the CPU frequency settings?
    # Set to 0 to disable
    CONTROL_CPU_FREQUENCY="auto"
    # Legal values are "slowest" for the slowest speed that your
    # CPU is able to operate at, "fastest" for the fastest speed,
    # "medium" for some value in the middle, or any value listed in
    # /sys/devices/system/cpu/cpu*/cpufreq/scaling_available_frequencies.
    # The "governor" can be any governor installed on your system, this usually
    # includes "ondemand", "conservative", and "performance". The
    # "IGNORE_NICE_LOAD" setting specifies that background programs that have
    # a low priority ("nice level") should not cause the CPU frequency to
    # be increased. (You generally want this to be enabled in battery mode.)
    BATT_CPU_MAXFREQ=fastest
    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
    # Should laptop mode tools control the CPU throttling? This is only useful
    # on processors that don't have frequency scaling.
    # (Only works when you have /proc/acpi/processor/CPU*/throttling.)
    # This is only useful on older P4 processors that do not support frequency
    # scaling. On such processors, this is the only way to reduce power consumption
    # but at the cost of higher performance penalty.
    # Enable this only if you have a processor that does not support frequency scaling
    # On most new processors, you might want to disable it.
    # Set to 0 to disable.
    CONTROL_CPU_THROTTLING=0
    # Legal values are "maximum" for the maximum (slowest) throttling level,
    # "minimum" for minimum (fastest) throttling level, "medium" for a value
    # somewhere in the middle (this is usually 50% for P4s), or any value listed
    # in /proc/acpi/processor/CPU*/throttling. Be careful when using "maximum":
    # this may be _very_ slow (in fact, with P4s it slows down the processor
    # by a factor 8).
    BATT_CPU_THROTTLING=medium
    LM_AC_CPU_THROTTLING=medium
    NOLM_AC_CPU_THROTTLING=minimum
    battery-level-polling.conf
    # Configuration file for Laptop Mode Tools module battery-level-polling.
    # For more information, consult the laptop-mode.conf(8) manual page.
    # Battery level polling settings
    # This module allows laptop mode to react to battery level changes, even if the
    # battery does not send out frequent ACPI events for such battery level changes.
    # Note that this does NOT make ACPI-only features work on non-ACPI hardware.
    # Enable debug mode for this module
    # Set to 1 if you want to debug this module
    DEBUG=0
    # Enable this setting to enable battery level polling.
    ENABLE_BATTERY_LEVEL_POLLING=1
    hal-polling.conf
    # Configuration file for Laptop Mode Tools module hal-polling.
    # For more information, consult the laptop-mode.conf(8) manual page.
    # HAL polling settings
    # If you enable this module, laptop mode tools will control the polling of
    # your CD/DVD drives by HAL. Disabling polling saves a considerable amount of
    # power, but for some older CD/DVD drives it means that inserted CDs are no
    # longer autodetected. In such cases, you must turn this option off.
    # Alternatively, you can configure laptop mode tools to turn HAL polling on only
    # when the laptop is running on AC power. This would mean that CDs are not
    # autodetected while the laptop is running on battery power, but the power
    # savings may be worth the extra manual labour when you insert a CD.
    # Enable debug mode for this module
    # Set to 1 if you want to debug this module
    DEBUG=0
    # Control HAL polling?
    # Set to 0 to disablei, vs "auto".
    CONTROL_HAL_POLLING=0
    # Disable HAL polling on battery?
    BATT_DISABLE_HAL_POLLING=0
    # Disable HAL polling on AC?
    AC_DISABLE_HAL_POLLING=0
    # Drives to apply HAL polling settings to
    HAL_POLLING_DEVICES="/dev/scd?"
    Please let me know if you require any additional information. Thank you in advance for any help.
    Last edited by Aesir (2011-04-14 14:35:09)

    Aesir wrote:Can I make BATT_CPU_GOVERNOR=conservative even if it is not listed in the scaling_available_governors file?
    If your governor isn't listed in scaling_available_governors, it won't work.  See stqn's link for info on adding governors.
    stqn wrote:Edit2: oh well, scrolling a bit up, the wiki says you don't need to add governors if you're using laptop-mode-tools... I don't know.
    You do need governors if you're using laptop-mode-tools, because all laptop-mode-tools does is flip between them automatically.
    If you're using cpufrequtils, you'll need the userspace governor for it to work properly.  I don't use cpufrequtils personally, so I'm not sure how to get it to work in conjunction with laptop-mode-tools.  You may have to disable frequency scaling in laptop-mode-tools by changing CONTROL_CPU_FREQUENCY to 0 in cpufreq.conf
    Edit - now that I think about it, maybe laptop-mode-tools and cpufrequtils know how to load the modules themselves automatically.  I guess try it and see if they can.  You can check which governor is in use with:
    $ cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
    You can also manually change governors by running (as root):
    #  echo "conservative" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
    Of course, substitue the governor you want.
    Last edited by redden0t8 (2011-03-29 19:27:12)

  • Xfce4-power-manager and laptop-mode-tools + backlight problems.

    Cross posted from here: https://bbs.archlinux.org/viewtopic.php?id=127992
    I don't know which forum it belongs to, so maybe a mod can close the one in the wrong forum.
    Out of curiosity, do these two tools conflict with each other? There seems to be some features that do the same thing, ie harddrive spin down time, but I'm not sure if these two will try to kill each other trying to configure the same power settings. If they do conflict, how could I go about disabling the conflicting parts (on either)? laptop-mode-tools claims it needs acpid "for ACPI support", however, acpid seems to be grabbing the standby event and throwing the laptop in standby despite the standby button bound to do nothing in xfce-power-manager. If I take out acpid, does that mean laptop-mode will no longer detect acpi events such as connecting/disconnecting AC power and thus not change modes when its plugged in?
    Another problem I've had after installing xfce4-power-manager is that when I use the brightness hotkeys the backlight gets stuck and starts flashing, locking up the system until I force shutdown. However, I can use the brightness plugin without trouble at all. What's causing the power manager to screw up setting the brightness since it clearly seems to work otherwise.

    It is easier to close this one and move the other thread over here. Just continue there.
    BTW better use the Report button when you want to have a thread of yours moved to another forum. That way it is guaranteed a mod will see this in time. And you never need to cross post.

  • [SOLVED] Systemd and laptop-mode-tools frequency scaling

    Hi all.
    After a long time with no arch updates (november 2011) for various reasons, I decided to reinstall Arch from point 0 on my Clevo laptop.
    I was pleased to see nothing went bad, all is now set like I want. I installed systemd yesterday. All very straightforward for me, I only have a problem with CPU frequency scaling plus some minor glitches.
    Before systemd, everything went fine. Ondemand governor, set up like I wanted.
    Now when on AC the system uses ondemand, but when on battery it uses the conservative governor. What's more, it does not go over 1.6GHz (2.54GHz max).
    Here are some infos about it:
    [adriano@M735T ~] cpupower frequency-info
    analyzing CPU 0:
    driver: acpi-cpufreq
    CPUs which run at the same hardware frequency: 0 1
    CPUs which need to have their frequency coordinated by software: 0
    maximum transition latency: 10.0 us.
    hardware limits: 800 MHz - 2.53 GHz
    available frequency steps: 2.53 GHz, 2.53 GHz, 1.60 GHz, 800 MHz
    available cpufreq governors: ondemand, performance
    current policy: frequency should be within 800 MHz and 1.60 GHz.
    The governor "ondemand" may decide which speed to use
    within this range.
    current CPU frequency is 1.60 GHz.
    boost state support:
    Supported: yes
    Active: yes
    [yes this is all come out of the cpupower command, no mention of CPU 1. Is this normal?]
    Of course LMT is set up correctly
    CONTROL_CPU_FREQUENCY="1"
    BATT_CPU_MAXFREQ=fastest
    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
    [adriano@M735T ~] sudo systemctl status laptop-mode-tools.service
    laptop-mode-tools.service - Laptop Power Saving Tools
    Loaded: loaded (/usr/lib/systemd/system/laptop-mode-tools.service; enabled)
    Active: active (exited) since Sun, 02 Sep 2012 17:03:45 +0200; 4h 34min ago
    Main PID: 367 (code=exited, status=0/SUCCESS)
    CGroup: name=systemd:/system/laptop-mode-tools.service
    Sep 02 17:03:43 M735T laptop_mode[367]: /usr/sbin/laptop_mode: line 198: /dev/fd/1: No such device or address
    Sep 02 17:03:44 M735T laptop_mode[367]: /usr/sbin/laptop_mode: line 198: /dev/fd/1: No such device or address
    Sep 02 17:03:44 M735T laptop_mode[367]: /usr/sbin/laptop_mode: line 198: /dev/fd/1: No such device or address
    I wonder why LMT status is "exited"
    OK bin that, I just now see something is wrong. I said it used conservative, but I'm on battery and it now says ondemand (still 1.6GHz max). However it seems it does so casually.
    ACPI:
    [adriano@M735T ~] acpi
    Battery 0: Discharging, 53%, rate information unavailable
    This may be (?) or may not be linked with nother problem I have: when unplugging the AC the KDE battery monitor does not update. It says AC is plugged and it will not activate power saving features (screen dimming, suspend...)
    Note that this battery monitor problem occurred even before systemd, so it should not be linked to the above problem. However I'm not 100% sure the above problems did not occur before installing systemd since I only had the system up and running for a comple of days. I seem to recall I checked and it worked fine.
    Any idea why all this happens?
    Last edited by OdinEidolon (2012-11-20 08:56:31)

    Ok rebooted and this is the output of the pm-powersave log file:
    (AC IN, no battery)
    (pastebin)
    http://pastebin.com/Kf2Lx7UQ
    If I grep cpupower:
    Running hook /usr/lib/pm-utils/power.d/cpupower false:
    Setting cpupower frequency governor to ondemand...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower false: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower true:
    Setting cpupower frequency governor to conservative...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower true: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower false:
    Setting cpupower frequency governor to ondemand...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower false: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower true:
    Setting cpupower frequency governor to conservative...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower true: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower true:
    Setting cpupower frequency governor to conservative...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower true: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower true:
    Setting cpupower frequency governor to conservative...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower true: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower true:
    Setting cpupower frequency governor to conservative...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower true: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower true:
    Setting cpupower frequency governor to conservative...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower true: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower false:
    Setting cpupower frequency governor to ondemand...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower false: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower true:
    Setting cpupower frequency governor to conservative...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower true: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower false:
    Setting cpupower frequency governor to ondemand...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower false: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower false:
    Setting cpupower frequency governor to ondemand...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower false: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower true:
    Setting cpupower frequency governor to conservative...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower true: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower true:
    Setting cpupower frequency governor to conservative...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower true: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower false:
    Setting cpupower frequency governor to ondemand...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower false: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower true:
    Setting cpupower frequency governor to conservative...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower true: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower false:
    Setting cpupower frequency governor to ondemand...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower false: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower true:
    Setting cpupower frequency governor to conservative...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower true: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower false:
    Setting cpupower frequency governor to ondemand...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower false: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower false:
    Setting cpupower frequency governor to ondemand...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower false: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower true:
    Setting cpupower frequency governor to conservative...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower true: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower false:
    Setting cpupower frequency governor to ondemand...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower false: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower true:
    Setting cpupower frequency governor to conservative...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower true: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower false:
    Setting cpupower frequency governor to ondemand...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower false: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower false:
    Setting cpupower frequency governor to ondemand...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower false: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower true:
    Setting cpupower frequency governor to conservative...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower true: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower false:
    Setting cpupower frequency governor to ondemand...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower false: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower true:
    Setting cpupower frequency governor to conservative...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower true: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower false:
    Setting cpupower frequency governor to ondemand...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower false: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower true:
    Setting cpupower frequency governor to conservative...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower true: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower true:
    Setting cpupower frequency governor to conservative...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower true: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower true:
    Setting cpupower frequency governor to conservative...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower true: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower true:
    Setting cpupower frequency governor to conservative...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower true: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower true:
    Setting cpupower frequency governor to conservative...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower true: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower true:
    Setting cpupower frequency governor to conservative...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower true: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower true:
    Setting cpupower frequency governor to conservative...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower true: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower true:
    Setting cpupower frequency governor to conservative...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower true: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower false:
    Setting cpupower frequency governor to ondemand...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower false: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower true:
    Setting cpupower frequency governor to conservative...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower true: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower false:
    Setting cpupower frequency governor to ondemand...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower false: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower true:
    Setting cpupower frequency governor to conservative...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower true: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower true:
    Setting cpupower frequency governor to conservative...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower true: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower false:
    Setting cpupower frequency governor to ondemand...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower false: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower true:
    Setting cpupower frequency governor to conservative...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower true: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower false:
    Setting cpupower frequency governor to ondemand...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower false: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower true:
    Setting cpupower frequency governor to conservative...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower true: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower false:
    Setting cpupower frequency governor to ondemand...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower false: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower true:
    Setting cpupower frequency governor to conservative...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower true: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower false:
    Setting cpupower frequency governor to ondemand...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower false: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower false:
    Setting cpupower frequency governor to ondemand...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower false: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower false:
    Setting cpupower frequency governor to ondemand...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower false: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower true:
    Setting cpupower frequency governor to conservative...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower true: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower false:
    Setting cpupower frequency governor to ondemand...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower false: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower true:
    Setting cpupower frequency governor to conservative...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower true: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower false:
    Setting cpupower frequency governor to ondemand...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower false: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower false:
    Setting cpupower frequency governor to ondemand...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower false: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower false:
    Setting cpupower frequency governor to ondemand...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower false: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower true:
    Setting cpupower frequency governor to conservative...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower true: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower false:
    Setting cpupower frequency governor to ondemand...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower false: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower true:
    Setting cpupower frequency governor to conservative...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower true: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower false:
    Setting cpupower frequency governor to ondemand...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower false: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower true:
    Setting cpupower frequency governor to conservative...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower true: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower true:
    Setting cpupower frequency governor to conservative...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower true: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower false:
    Setting cpupower frequency governor to ondemand...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower false: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower false:
    Setting cpupower frequency governor to ondemand...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower false: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower false:
    Setting cpupower frequency governor to ondemand...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower false: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower true:
    Setting cpupower frequency governor to conservative...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower true: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower false:
    Setting cpupower frequency governor to ondemand...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower false: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower true:
    Setting cpupower frequency governor to conservative...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower true: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower false:
    Setting cpupower frequency governor to ondemand...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower false: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower false:
    Setting cpupower frequency governor to ondemand...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower false: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower false:
    Setting cpupower frequency governor to ondemand...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower false: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower true:
    Setting cpupower frequency governor to conservative...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower true: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower true:
    Setting cpupower frequency governor to conservative...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower true: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower false:
    Setting cpupower frequency governor to ondemand...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower false: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower true:
    Setting cpupower frequency governor to conservative...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower true: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower true:
    Setting cpupower frequency governor to conservative...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower true: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower true:
    Setting cpupower frequency governor to conservative...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower true: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower false:
    Setting cpupower frequency governor to ondemand...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower false: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower true:
    Setting cpupower frequency governor to conservative...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower true: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower true:
    Setting cpupower frequency governor to conservative...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower true: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower true:
    Setting cpupower frequency governor to conservative...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower true: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower false:
    Setting cpupower frequency governor to ondemand...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower false: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower true:
    Setting cpupower frequency governor to conservative...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower true: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower false:
    Setting cpupower frequency governor to ondemand...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower false: success.
    Running hook /usr/lib/pm-utils/power.d/cpupower false:
    Setting cpupower frequency governor to ondemand...Setting cpu: 0
    /usr/lib/pm-utils/power.d/cpupower false: success.
    right now:
    1) cpupower reports ondemand and 2.54GHz (right)
    2) acpi -bi reports nothing as it should (battery is disconnected)
    3) acpi -a reports AC in as it should
    4) all KDE stuff works OK
    Now I plug the battery in:
    1) cpupower reports ondemand and 2.54GHz (right)
    2) acpi -bi reports nothing, which is wrong
    3) acpi -a reports AC in as it should
    4) KDE battery monitor reports no battery in, as signaled by acpi
    5) if performing acpi_listen ,it reports nothing interesting
    Now I unplug AC:
    Absolutely nothing changes (not even in the log file) but:
    1) cpupower reports ondemand and 1.6GHz (wrong)
    2) acpi -bi reports nothing, which is wrong
    3) acpi -a reports no AC as it should
    4) KDE battery monitor reports no battery in, as signaled by acpi,  but it also reports AC is inserted

  • Laptop-mode-tools no power saving

    Hi,
    I use laptop-mode-tools for several months and it worked fine, however lately when my laptop runs on battery it seems that no power saving options kick in, since I get a battery time around 1 and half an hour, while it used to be 4 hours.
    It may be connected to that I removed initscripts from the system, however laptop-mode.service is enabled and started, journal says events are picked up, laptop-mode-tool modules are loaded, I can see e.g. that cpu freq is cut back, so I'm confused a bit. I spent hours going through the config files and browsing the journal, but I must have missed something.
    Please advise where to look or what to check. Thank you.
    If you need any log or config file, additional information, please let me know.

    Have you tried powerdown? Here's a link to one of their threads.  https://bbs.archlinux.org/viewtopic.php?id=134109&p=1
    Link to aur = https://aur.archlinux.org/packages.php?ID=57421
    Wiki = https://wiki.archlinux.org/index.php/Powerdown
    It is just a bunch of scripts written by a forum member.  I just came across it recently as I only used arch on desktop until now.  Fuduntu was boasting their battery life preset on their distro but I find that with these scripts and changing them to your needs, you get far better results.  I have a 9 cell on my asus eee 1005ha getting 11-12 hours of internet browsing and writing.

  • [SOLVED] Temporarely enable/disable laptop-mode-tools while on AC?

    There's an option in laptop-mode.conf for it to run on AC by default
    # Enable laptop mode when on battery power.
    ENABLE_LAPTOP_MODE_ON_BATTERY=1
    # Enable laptop mode when on AC power.
    ENABLE_LAPTOP_MODE_ON_AC=0
    I'd like to keep it off on AC like it is by default, there's just scenarios where I'd like my laptop to run especially quiet, even if plugged in (eg. gf sleeping)
    Is there a command to turn it on/off on demand?
    Last edited by Winston-Wolfe (2013-06-06 11:10:41)

    "laptop_mode stop/start/auto", I'd say.

  • [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)

  • 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 Configurations (laptop mode tools)

    Hello,
    I am in the process of configuring my laptop and have some simple questions that I would like to verify with people. I am running arch on a Sony Vaio laptop with a Toshiba ATA hard drive.
    1) I have heard quite a bit about being careful with APM to avoid shortening life of hard drive.  I have set the following settings in my laptop-mode.conf file:
    # LM_something=value Value of "something" when laptop mode is active
    # NOLM_something=value Value of "something" when laptop mode is NOT
    # active
    # AC_something=value Value of "something" when the computer is running
    # on AC power
    # BATT_something=value Value of "something when the computer is running
    # on battery power
    # Power management for HD (hdparm -B values)
    BATT_HD_POWERMGMT=128
    LM_AC_HD_POWERMGMT=254
    NOLM_AC_HD_POWERMGMT=254
    As I understood the arch wiki, these settings should be good for most laptops.  I don't move the laptop much when it's plugged in (I think the latter two are plugged in) and can have a higher hdparm value.  128 should be good if I am on battery, when I may move the laptop around more (so lower to avoid HD damage).  Could anyone confirm that I understood this correctly so that I don't damage anything.
    2) I am using s2disk to hibernate the computer.  Is there any way using laptop-mode-tools or another method to make it so that the computer automatically hibernates if lid is closed
    3) I am a not certain whether this should be turned on or off (I am leaning towards off since I don't have SATA, but it was by default on)
    # If this is enabled, laptop mode tools will assume that SCSI drives are
    # really SATA drives that only _look_ like SCSI drives, and will use hdparm
    # to control them. Set this to 0 if you have /dev/sd devices and you want
    # laptop mode tools to use the "sdparm" command to control them.
    ASSUME_SCSI_IS_SATA=1
    Thank you very much!
    Last edited by Aesir (2011-02-05 06:44:17)

    I have not responded sooner because I did not have an opinion, but I tend to agree with flan_suse.
    For what they are, laptops are amazing things.  The processing power packed into the things is staggering.  More so is the storage.
    When I was in school, hard drives were measured in terms of 10s of megabytes, drives had masses on the order of 20kg, and head crashes were common and disastrous.  That we can walk around with 2kg laptops that have 10,000 times the storage available in rack mount systems 25 years ago is amazing. 
    But, by nature, laptops encounter some brutal handling.  If the heads are flying when the machine takes a shock, it will likely crash the heads.  Letting them park after a timeout really won't diminish this risk.   Many laptops now have accelerometers to detect a drop and can unload the heads while the machine is falling.  It is a good idea, but I've no idea how well implemented that is.  There is support for this in Linux, but I really have not test it.
    That you want to protect your investment is noted.  Never-the-less, laptops operate in a rough environment.  Data is highly valuable. Drives are cheap (I know you are a student, but they really are cheap).  Get an external drive and keep your internal drive backed up.  Set the APM to 254 to save load cycles.  Watch your SMART info and watch for signs of impeding failure.  When the drive starts to show signs of wear out or failure, save yourself headaches and just replace it.

  • Disk still wakes up with laptop-mode-tools

    Hi all,
    I have a Thinkpad x61 and I'm trying to manage power use with laptop-mode-tools, but I'm having trouble with the harddrive waking up too much. I have it configured so that lm-tools activates when the power is disconnected, and sure enough, a few seconds later the harddrive spins down. But 1-2 seconds later it spins back up! iotop indicates that dhcpcd is writing to the drive, and thus waking it up.
    I thought lm-tools was set so that I could "potentially lose up to 10 minutes of work." Shouldn't that mean that up to 10 minutes of writes get buffered in ram instead of waking up the harddrive? If I disable the network, dhcpcd stops waking things up, but if I save a buffer from emacs, the harddrive instantly wakes up, so it looks like there's no buffering going on...
    Here are some relevant settings while in laptop-mode:
    $ dmesg|tail
    [15425.800826] EXT4-fs (sda1): re-mounted. Opts: data=ordered,commit=600
    [15425.982220] EXT4-fs (sda2): re-mounted. Opts: data=ordered,commit=600
    $ cat /proc/sys/vm/dirty_writeback_centisecs
    60000
    $ cat /proc/sys/vm/dirty_expire_centisecs
    60000
    $ cat /proc/sys/vm/dirty_bytes
    0
    $ cat /proc/sys/vm/dirty_background_bytes
    0
    $ cat /proc/sys/vm/dirty_background_ratio
    1
    It looks like dirty_writeback is getting set to 10 minutes and the journal commit rate is also set to 10 minutes. Should dirty_background_bytes and dirty_bytes be nonzero?
    Here are some relevant lines from /etc/laptop-mode/laptop-mode.conf:
    LM_BATT_MAX_LOST_WORK_SECONDS=600
    CONTROL_READAHEAD=1
    LM_READAHEAD=3072
    CONTROL_NOATIME=0
    USE_RELATIME=1
    CONTROL_HD_IDLE_TIMEOUT=1
    LM_BATT_HD_IDLE_TIMEOUT_SECONDS=10
    BATT_HD_POWERMGMT=1
    CONTROL_HD_WRITECACHE=1
    NOLM_AC_HD_WRITECACHE=1
    NOLM_BATT_HD_WRITECACHE=0
    LM_HD_WRITECACHE=0
    Any ideas what I'm missing?
    Thanks in advance for any suggestions!

    kaczoanoker wrote:I noticed that vim and emacs wake up the HD in laptop mode, but something like "dd if=/dev/zero of=~/test bs=1M count=1" doesn't. Does it mean that editors typically force-flush the buffers, which defeats the point of laptop-mode?
    Vim calls fsync(2) when writing files and swap files per default. One can control this behavior with the fsync and swapsync options.
    I don't know if Emacs has similar options.

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

Maybe you are looking for

  • No longer connects to ONLY my website

    I've always been able to wirelessly connect to any site that's up until about 3 weeks ago. I turned on my Macbook and tried going to my website and it didn't load, so I thought it was just down so I came back to it about an hour later with no change.

  • Itunes 7.4 for windows playlist

    recently upgraded to itunes 7.4. my old playlists were gone, when i created new ones to sync to ipod later, after shutting down itunes and reopening it the next day my playlists were gone. Cannot save new playlists since. Help please?

  • How to define user status that forbids editing the document

    Hi All, Im working on CRM 7.0 I need to define a user status say " ON HOLD" . when this user status is set the document should not be edited or changed by anyone.  However as soon as we move to next status document should be editable. I configured a

  • How Can I Fix Address Book in Mail?

    After downloading 10.9 Address Book in Mail no longer works for groups.  I can enter individual names from Address book to email, but not names in groups.  How can I fix it?  Thanks.

  • Determine company code and location (plant) w.r.t., cost center

    Hi, How could i determine company code and location based on given cost center. Could anybody please let me know if any table or function module is available to get this. Thank you