You are not logged in.
Hello Community,
I'm using the common sysvinit initscripts, so the following problem should not be related to systemd.
I just made some powersaving settings as advised in https://wiki.archlinux.org/index.php/Powertop in /etc/rc.local, so for example
echo min_power > /sys/class/scsi_host/host0/link_power_management_policyAfter rebooting I checked the settings and found...
$ cat /sys/class/scsi_host/host0/link_power_management_policy
max_performanceThis is my complete rc.local file:
#!/bin/bash
#
# /etc/rc.local: Local multi-user startup script.
#
# Keep dirty writes in memory
echo 90 > /proc/sys/vm/dirty_ratio
# Keep dirty writes out of cache
echo 5 > /proc/sys/vm/dirty_background_ratio
# VM writeback timeout
echo 6000 > /proc/sys/vm/dirty_writeback_centisecs
# SATA Active Link Powermanagement
echo min_power > /sys/class/scsi_host/host0/link_power_management_policy
# set Advanced Power Management feature
hdparm -B 128 /dev/sdaThe upper "echo" commands aren't executed, as well as the SATA Active Link Powermanagement.
Strange enough, but the hdparm command seems to be executed. I see the output in the boot messages and in /var/log/boot:
Wed Sep 5 13:11:22 2012: /dev/sda:
Wed Sep 5 13:11:22 2012: setting Advanced Power Management level to 0x80 (128)
Wed Sep 5 13:11:23 2012: APM_level = 128Does anybody have a clue, why the "echo" commands aren't executed while the hdparm is?
Any hint would really be appreciated!
Offline
It has long been known.
https://bugs.launchpad.net/ubuntu/+sour … bug/427925
https://bugs.launchpad.net/ubuntu/+sour … bug/431822
In general, it comes down to that not all host controllers support this.
Do other numbers of hosts save settings?
Offline
Thank you for your answer, but this bug can't be the reason, because if I execute the commands as root after booting, all settings are made:
$ echo 90 > /proc/sys/vm/dirty_ratio
$ cat /proc/sys/vm/dirty_ratio
90
$ echo 5 > /proc/sys/vm/dirty_background_ratio
$ cat /proc/sys/vm/dirty_background_ratio
5
$ echo 6000 > /proc/sys/vm/dirty_writeback_centisecs
$ cat /proc/sys/vm/dirty_writeback_centisecs
6000
$ echo min_power > /sys/class/scsi_host/host0/link_power_management_policy
$ cat /sys/class/scsi_host/host0/link_power_management_policy
min_powerIt is just the execution in the boot process in rc.local which is not done.
Offline
Hm, but what if you try to use сustom hooks?
https://wiki.archlinux.org/index.php/Arch_Boot_Process
Offline
Okay, I have created a custom hook script in /etc/rc.d/functions.d/ on the basis of https://wiki.archlinux.org/index.php/Ar … stom_hooks
$ cat /etc/rc.d/functions.d/testingscript
testingscript() {
echo 2000 > /proc/sys/vm/dirty_writeback_centisecs
}
add_hook multi_end testingscriptAfter rebooting, I tried cat /proc/sys/vm/dirty_writeback_centisecs:
$ cat /proc/sys/vm/dirty_writeback_centisecs
500It seems that also custom hooks aren't executed... WTF?
Offline
Okay, the misfunction of the testingscript above was my mistake, I forgot to chmod +x /etc/rc.d/functions.d/testingscript. After rebooting, I got
$ cat /proc/sys/vm/dirty_writeback_centisecs
2000But the rc.local issue remains unsolved (yes, rc.local is executable!). Any further hints?
Offline
Is rc.local executable? Maybe you accidentally removed the flag. Sorry I skipped the paranthesis Also try to echo somethin in e.g. /tmp/testfile where you don't need root permissions. If that works, read one of the proc files and echo the content to the testfile. Then you know that it is at least readable.
Last edited by progandy (2012-09-05 17:44:58)
| alias CUTF='LANG=en_XX.UTF-8@POSIX ' | alias ENGLISH='LANG=C.UTF-8 ' |
Offline
But the rc.local issue remains unsolved (yes, rc.local is executable!). Any further hints?
Good question, indeed! ![]()
I'm also using the common sysvinit initscripts and check executioning some of these commands.
Many settings of powersaving was reseted to max_performance but simple commands I has tryed (touch; echo "WTF" > /home/.../wtf.txt) was performed.
It means that rc.local is working, but then settings of powersaving are reseted.
I has searched about this question in other forums and saw that people have same problems. However, there is no solution in forums. Maybe the scsi-devices is not ready during script execution?
Last edited by solamir (2012-09-05 17:42:51)
Offline
I think scsi-devices isn't ready yet true. If put the script
#!/bin/sh
sh -c "echo 'min_power' > /sys/class/scsi_host/host0/link_power_management_policy"
exit 0in ~/.kde4/Autostart/ and make it executable without password with /etc/sudorc all will work.
You are able use this way. Also maybe you should use laptop-mode-tools, which will switch this settings automatically when power off.
Last edited by solamir (2012-09-05 19:41:45)
Offline
Hello Community,
I'm using the common sysvinit initscripts, so the following problem should not be related to systemd.
I just made some powersaving settings as advised in https://wiki.archlinux.org/index.php/Powertop in /etc/rc.local, so for example
echo min_power > /sys/class/scsi_host/host0/link_power_management_policyAfter rebooting I checked the settings and found...
$ cat /sys/class/scsi_host/host0/link_power_management_policy max_performanceThis is my complete rc.local file:
#!/bin/bash # # /etc/rc.local: Local multi-user startup script. # # Keep dirty writes in memory echo 90 > /proc/sys/vm/dirty_ratio # Keep dirty writes out of cache echo 5 > /proc/sys/vm/dirty_background_ratio # VM writeback timeout echo 6000 > /proc/sys/vm/dirty_writeback_centisecs # SATA Active Link Powermanagement echo min_power > /sys/class/scsi_host/host0/link_power_management_policy # set Advanced Power Management feature hdparm -B 128 /dev/sdaThe upper "echo" commands aren't executed, as well as the SATA Active Link Powermanagement.
Strange enough, but the hdparm command seems to be executed. I see the output in the boot messages and in /var/log/boot:
Wed Sep 5 13:11:22 2012: /dev/sda: Wed Sep 5 13:11:22 2012: setting Advanced Power Management level to 0x80 (128) Wed Sep 5 13:11:23 2012: APM_level = 128Does anybody have a clue, why the "echo" commands aren't executed while the hdparm is?
Any hint would really be appreciated!
What desktop do you use? Specifically, do you run upower? This seems to be related to upower's call to pm-powersave which would turn on high-performance settings when running on AC...
FWIW, here is my rc.local
. /etc/rc.conf
. /etc/rc.d/functions
echo "Entering rc.local"
stat_busy "Setting WiFi powersave"
iw dev wlan0 set power_save on
if [ $? -gt 0 ]; then
stat_fail
else
stat_done
fi
stat_busy "Setting CPU and SCSI powersavings"
echo 99 > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold
for h in /sys/class/scsi_host/host?; do
if [ -f $h/link_power_management_policy ]; then
echo "min_power" > $h/link_power_management_policy
fi
done
stat_done
stat_busy "Remount /dev/shm noexec"
mount -o remount,noexec /dev/shm
if [ $? -gt 0 ]; then
stat_fail
else
stat_done
fiand
$ for h in /sys/class/scsi_host/host?; do cat $h/link_power_management_policy; done
min_power
min_power
min_power
min_powerArch Linux is more than just GNU/Linux -- it's an adventure
pkill -9 systemd
Offline
What desktop do you use? Specifically, do you run upower? This seems to be related to upower's call to pm-powersave which would turn on high-performance settings when running on AC...
I use XFCE 4.10 and in the dependencies is upower (in pstree and htop I see running multiple instances of upowerd).
Thank you for this hint, I think upowerd is to blame. I have written a short script to read one of the proc files immediately after writing my custum value into it and got the correct custom value:
rc.local:
echo 90 > /proc/sys/vm/dirty_ratio
cat /proc/sys/vm/dirty_ratio | while read line; do echo "${line}" > /tmp/dirtyratio ; doneAfter logging into XFCE and checking the two values I got:
$ cat /tmp/dirtyratio
90
BUT
$ cat /proc/sys/vm/dirty_ratio
30It seems that /etc/rc.local is executed correctly, but upowerd alters the values in /proc after some seconds. I have yet not found a solution, because there is really less information about this crappy upower, but it seems to be connected with dbus.
Last edited by indianahorst (2012-09-06 10:56:40)
Offline
There are two ways in which you can solve your problem:
1. Alter pm-utils config. Namely, you'll have to disable offending hooks in /usr/lib/pm-utils/power.d. For instance:
$ cat /etc/pm/config.d/00-disable-all-hooks.conf
HOOK_BLACKLIST="hal-cd-polling journal-commit pcie_aspm sata_alpm wireless intel-audio-powersave laptop-mode readahead sched-powersave xfs_buffer"2. Disable upower call to pm-utils alltogether. In /etc/Upower/Upower.conf change RunPowersaveCommand from true (default) to false.
EDIT: By default xfce-session doesn't call upower. on startup, but only on shutdown You must be using some power applet...
Last edited by Leonid.I (2012-09-06 17:34:24)
Arch Linux is more than just GNU/Linux -- it's an adventure
pkill -9 systemd
Offline