You are not logged in.

#1 2010-09-01 10:53:37

Singul
Member
Registered: 2010-03-24
Posts: 25

Problem with powersaving stuff in rc.local

Hi,

I have a strange problem with the entries in my rc.local which are relevant for powersaving. First the file, which looks like this:

#!/bin/bash
#
# /etc/rc.local: Local multi-user startup script.
#

#avoid hdd spindown for longer life :)
hdparm -B 254 -S 0 /dev/sda

#set lower cpu voltages
echo "25 23 21 17" > /sys/devices/system/cpu/cpu0/cpufreq/phc_vids
echo "25 23 21 17" > /sys/devices/system/cpu/cpu1/cpufreq/phc_vids

#use sata link power management
echo "min_power" > /sys/class/scsi_host/host0/link_power_management_policy
echo "min_power" > /sys/class/scsi_host/host1/link_power_management_policy
echo "min_power" > /sys/class/scsi_host/host2/link_power_management_policy
echo "min_power" > /sys/class/scsi_host/host3/link_power_management_policy

#set power saving mode for hda_intel
echo 1 > /sys/module/snd_hda_intel/parameters/power_save

#increase writeback time to 15s
echo 1500 > /proc/sys/vm/dirty_writeback_centisecs

#disable unused outputs
xrandr --output DP1 --off
xrandr --output DP2 --off
xrandr --output TV1 --off
xrandr --output HDMI1 --off

#enable kernel laptop mode for i/o
echo 5 > /proc/sys/vm/laptop_mode

#enable wlan power saving mode
iwconfig wlan0 power on

Not e.g. the phc_vids are written correctly, which means that they are exactly what I set in rc.local when I check them. Same goes for hda_intel powersave, but e.g. the line

echo 5 > /proc/sys/vm/laptop_mode

(is 0 when I check it after booting) or the link_power_management_policy stuff (is set to max_performance when I check it) seem to have no influence. Though, when I set these manually, they work like a charm.

Does anyone have an idea why this happens? Thanks in advance smile

Offline

#2 2010-09-13 07:13:53

ewigkeit
Member
Registered: 2009-01-06
Posts: 53

Re: Problem with powersaving stuff in rc.local

Hi Singul,

just a wild guess - but maybe it could help, to issue the commands, which doesn't work, with "sleep". I played around with it myself some time ago and it helps to start some processes when the computer / hard drive isn't stressed as much after booting the system. It's worth a try.

Example:

sleep 60 && echo 5 > /proc/sys/vm/laptop_mode &

Offline

#3 2010-09-13 10:17:02

Singul
Member
Registered: 2010-03-24
Posts: 25

Re: Problem with powersaving stuff in rc.local

Sounds a little bit strange, I really do not know why this should work...but I'll give it a shot and report back smile

Offline

#4 2010-09-13 18:33:30

Singul
Member
Registered: 2010-03-24
Posts: 25

Re: Problem with powersaving stuff in rc.local

Tried your suggestion, but had no effect sad

Though, when executed manually after booting, it works without problems. I really don't get what is going on there :S

Offline

#5 2010-09-13 19:38:24

Coacher
Guest

Re: Problem with powersaving stuff in rc.local

try

#chmod a+x /etc/rc.local

just in case.

#6 2010-09-13 23:28:28

ngoonee
Forum Fellow
From: Between Thailand and Singapore
Registered: 2009-03-17
Posts: 7,355

Re: Problem with powersaving stuff in rc.local

Do you have something else setting alternate values. For example the laptop-mode daemon.


Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.

Offline

#7 2010-09-14 09:26:35

Singul
Member
Registered: 2010-03-24
Posts: 25

Re: Problem with powersaving stuff in rc.local

No laptop-mode daemon here...are there any other common tools which set some of these values? But..even if there are...shouldn't rc.local be executed last?

Offline

Board footer

Powered by FluxBB