Lieber Besucher, herzlich willkommen bei: GentooForum.de. Falls dies Ihr erster Besuch auf dieser Seite ist, lesen Sie sich bitte die Hilfe durch. Dort wird Ihnen die Bedienung dieser Seite näher erläutert. Darüber hinaus sollten Sie sich registrieren, um alle Funktionen dieser Seite nutzen zu können. Benutzen Sie das Registrierungsformular, um sich zu registrieren oder informieren Sie sich ausführlich über den Registrierungsvorgang. Falls Sie sich bereits zu einem früheren Zeitpunkt registriert haben, können Sie sich hier anmelden.
Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von »flatron« (05.04.2007, 11:51)
Quellcode |
|
1 2 3 4 |
/usr/sbin/radeontool light off # go to sleep sleep 5 && echo -n "mem" > /sys/power/state |
Quellcode |
|
1 2 3 4 |
/etc/acpi/actions/sleep.sh: line 19: echo: write error: Operation not permitted [Thu Apr 5 02:24:53 2007] END HANDLER MESSAGES [Thu Apr 5 02:24:53 2007] action exited with status 0 [Thu Apr 5 02:24:53 2007] completed event "ibm/hotkey HKEY 00000080 00001004" |
Quellcode |
|
1 2 |
env > /tmp/env.log ls -la /sys/power/state > /tmp/state_mod.log |
Quellcode |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
MANPATH=/usr/local/share/man:/usr/share/man:/usr/share/binutils-data/i686-pc-linux-gnu/2.16.1/man:/usr/share/gcc-data/i686-pc-linux-gnu/4.1.1/man:/etc/java-config/system-vm/man/:/usr/qt/3/doc/man KDE_MULTIHEAD=false DM_CONTROL=/var/run/xdmctl TERM=xterm SHELL=/bin/bash XDM_MANAGED=/var/run/xdmctl/xdmctl-:0,maysd,mayfn,sched,rsvd,method=classic GTK2_RC_FILES=/etc/gtk-2.0/gtkrc:/home/michael/.gtkrc-2.0:/home/michael/.kde3.5/share/config/gtkrc-2.0 GTK_RC_FILES=/etc/gtk/gtkrc:/home/michael/.gtkrc:/home/michael/.kde3.5/share/config/gtkrc GS_LIB=/home/michael/.fonts WINDOWID=46137415 QTDIR=/usr/qt/3 OLDPWD=/etc/acpi ANT_HOME=/usr/share/ant-core KDE_FULL_SESSION=true USER=michael LS_COLORS=no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=01;05;37;41:mi=01;05;37;41:su=37;41:sg=30;43:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.mng=01;35:*.pcx=01;35:*.yuv=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.pdf=00;32:*.ps=00;32:*.txt=00;32:*.patch=00;32:*.diff=00;32:*.log=00;32:*.tex=00;32:*.doc=00;32:*.flac=01;35:*.mp3=01;35:*.mpc=00;36:*.ogg=00;36:*.wav=00;36:*.mid=00;36:*.midi=00;36:*.au=00;36:*.flac=00;36:*.aac=00;36:*.ra=01;36:*.mka=01;36: PRELINK_PATH_MASK=/usr/lib/gstreamer-0.10 GDK_USE_XFT=1 SESSION_MANAGER=local/localhost:/tmp/.ICE-unix/10954 PAGER=/usr/bin/less CONFIG_PROTECT_MASK=/etc/java-config/vms/ /etc/env.d/java/ /etc/gconf /etc/terminfo /etc/texmf/web2c /etc/revdep-rebuild XDG_CONFIG_DIRS=/usr/kde/3.5/etc/xdg KONSOLE_DCOP=DCOPRef(konsole-11078,konsole) DESKTOP_SESSION=kde-3.5 PATH=/usr/kde/3.5/bin:/usr/local/bin:/usr/bin:/bin:/opt/bin:/usr/i686-pc-linux-gnu/gcc-bin/4.1.1:/usr/kde/3.5/bin:/usr/qt/3/bin:/usr/games/bin KONSOLE_DCOP_SESSION=DCOPRef(konsole-11078,session-4) PWD=/etc/acpi/actions JAVA_HOME=/etc/java-config-2/current-system-vm JAVAC=/etc/java-config-2/current-system-vm/bin/javac EDITOR=/usr/bin/vim QMAKESPEC=linux-g++ KDEDIRS=/usr/kde/3.5:/usr:/usr/local JDK_HOME=/etc/java-config-2/current-system-vm SHLVL=2 HOME=/home/michael XCURSOR_THEME=default PYTHONPATH=/usr/lib/portage/pym LESS=-R -M --shift 5 G_FILENAME_ENCODING=UTF-8 LOGNAME=michael CVS_RSH=ssh CLASSPATH=. XDG_DATA_DIRS=/usr/kde/3.5/share:/usr/share DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-5yXiKYEjm1,guid=c9014b0d7b9b3e54f6b832004613c4a2 LESSOPEN=|lesspipe.sh %s INFOPATH=/usr/share/info:/usr/share/binutils-data/i686-pc-linux-gnu/2.16.1/info:/usr/share/gcc-data/i686-pc-linux-gnu/4.1.1/info DISPLAY=:0.0 OPENGL_PROFILE=xorg-x11 G_BROKEN_FILENAMES=1 CONFIG_PROTECT=/usr/share/X11/xkb /usr/kde/3.5/share/config /usr/kde/3.5/env /usr/kde/3.5/shutdown /usr/share/config COLORTERM= _=/usr/bin/env |
Quellcode |
|
1 |
-rw-r--r-- 1 root root 4096 Apr 5 02:24 state |
Quellcode |
|
1 2 3 |
ps ax -o uid,cmd | grep acpid for i in /etc/acpi/*; do echo $i; cat $i; echo -e "\n====\n"; done for i in /etc/acpi/events/*; do echo $i; cat $i; echo -e "\n====\n"; done |
Quellcode |
|
1 2 |
0 [kacpid] 0 /usr/sbin/acpid -c /etc/acpi/events |
Quellcode |
|
1 2 |
/etc/acpi/actions cat: /etc/acpi/actions: Is a directory |
Quellcode |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
/etc/acpi/default.sh #!/bin/sh # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: /var/cvsroot/gentoo-x86/sys-power/acpid/files/acpid-1.0.4-default.sh,v 1.1 2005/03/15 19:15:53 ciaranm Exp $ # Default acpi script that takes an entry for all actions set $* group=${1/\/*/} action=${1/*\//} case "$group" in button) case "$action" in power) /sbin/init 0 ;; *) logger "ACPI action $action is not defined" ;; esac ;; *) logger "ACPI group $group / action $action is not defined" ;; esac |
Quellcode |
|
1 2 |
/etc/acpi/events cat: /etc/acpi/events: Is a directory |
Quellcode |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 |
/etc/acpi/sleep.sh #!/bin/sh # sleep.sh test script for measuring power drain during suspend-to-ram with ACPI # default settings, change if needed LOG=/var/log/battery.log BATTERY=BAT0 THRESHOLD=1000 if ! grep -q '^charging state:.*discharging' /proc/acpi/battery/$BATTERY/state; then echo 'Not running on battery power, did you forget to disconnect the charger?' exit 1 fi if [ "$UID" != "0" ]; then echo 'This script can only be run by root.' exit 1 fi # remove USB for external mouse before sleeping if lsmod | grep '^usbhid' >/dev/null ; then /sbin/modprobe -r -s usbhid fi if lsmod | grep '^uhci_hcd' >/dev/null ; then /sbin/modprobe -r -s uhci_hcd fi if lsmod | grep '^ehci_hcd' >/dev/null ; then /sbin/modprobe -r -s ehci_hcd fi # save system time hwclock --systohc # get start values date >> $LOG DATE_BEFORE=`date +%s` BAT_BEFORE=`grep 'remaining capacity' /proc/acpi/battery/$BATTERY/state | awk '{print $3}'` # go to sleep if [ -e /proc/acpi/sleep ]; then echo 3 > /proc/acpi/sleep else echo -n mem > /sys/power/state fi # get end values DATE_AFTER=`date +%s` BAT_AFTER=`grep 'remaining capacity' /proc/acpi/battery/$BATTERY/state | awk '{print $3}'` # do the calculations DIFF=`echo "$BAT_AFTER - $BAT_BEFORE" | bc` SECONDS=`echo "$DATE_AFTER - $DATE_BEFORE" | bc` USAGE=`echo "($DIFF * 60 * 60) / ($SECONDS)" | bc` # output the results echo "before: $BAT_BEFORE mWh" >> $LOG echo "after: $BAT_AFTER mWh" >> $LOG echo "diff: $DIFF mWh" >> $LOG echo "seconds: $SECONDS sec" >> $LOG echo "result: $USAGE mW" >> $LOG if [ $USAGE -gt -$THRESHOLD ] then echo "Congratulations, your model seems NOT to be affected." >> $LOG else echo "Your model seems to be affected." >> $LOG fi if [ $SECONDS -lt 1200 ] then echo "!!! The notebook was suspended less than 20 minutes." >> $LOG echo "!!! To get representative values please let the notebook sleep" >> $LOG echo "!!! for at least 20 minutes." >> $LOG fi echo "" >> $LOG # restore USB support if !(lsmod | grep '^ehci_hcd') >/dev/null ; then /sbin/modprobe -s ehci_hcd fi if !(lsmod | grep '^uhci_hcd') >/dev/null ; then /sbin/modprobe -s uhci_hcd fi if !(lsmod | grep '^usbhid') >/dev/null ; then /sbin/modprobe -s usbhid fi # restore system time hwclock --hctosys |
Quellcode |
|
1 2 3 |
/etc/acpi/events/battery event=battery BAT0 00000080 00000001 action=/etc/acpi/actions/pmg_switch_runlevel.sh |
Quellcode |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
/etc/acpi/events/default # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: /var/cvsroot/gentoo-x86/sys-power/acpid/files/acpid-1.0.4-default,v 1.2 2005/04/24 16:21:45 brix Exp $ # This is the ACPID default configuration, it takes all # events and passes them to /etc/acpi/default.sh for further # processing. # event keeps a regular expression matching the event. To get # power events only, just use something like "event=button[ /]power.*" # to catch it. # action keeps the command to be executed after an event occurs # In case of the power event above, your entry may look this way: #event=button[ /]power.* #action=/sbin/init 0 # Optionally you can specify the placeholder %e. It will pass # through the whole kernel event message to the program you've # specified. #event=.* #action=/etc/acpi/default.sh %e |
Quellcode |
|
1 2 3 |
/etc/acpi/events/lid event=button/lid action=/etc/acpi/actions/sleep.sh %e |
Quellcode |
|
1 2 3 |
/etc/acpi/events/sleep_fn4 event=ibm/hotkey HKEY 00000080 00001004 action=/etc/acpi/actions/sleep.sh |
Quellcode |
|
1 |
for i in /etc/acpi/actions/*; do echo $i; cat $i; echo -e "\n====\n"; done |
Quellcode |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 |
#!/bin/sh # sleep.sh test script for measuring power drain during suspend-to-ram with ACPI # default settings, change if needed LOG=/var/log/battery.log BATTERY=BAT0 THRESHOLD=1000 if ! grep -q '^charging state:.*discharging' /proc/acpi/battery/$BATTERY/state; then echo 'Not running on battery power, did you forget to disconnect the charger?' exit 1 fi if [ "$UID" != "0" ]; then echo 'This script can only be run by root.' exit 1 fi # remove USB for external mouse before sleeping if lsmod | grep '^usbhid' >/dev/null ; then /sbin/modprobe -r -s usbhid fi if lsmod | grep '^uhci_hcd' >/dev/null ; then /sbin/modprobe -r -s uhci_hcd fi if lsmod | grep '^ehci_hcd' >/dev/null ; then /sbin/modprobe -r -s ehci_hcd fi # save system time hwclock --systohc # get start values date >> $LOG DATE_BEFORE=`date +%s` BAT_BEFORE=`grep 'remaining capacity' /proc/acpi/battery/$BATTERY/state | awk '{print $3}'` # go to sleep if [ -e /proc/acpi/sleep ]; then echo 3 > /proc/acpi/sleep else echo -n mem > /sys/power/state fi # get end values DATE_AFTER=`date +%s` BAT_AFTER=`grep 'remaining capacity' /proc/acpi/battery/$BATTERY/state | awk '{print $3}'` # do the calculations DIFF=`echo "$BAT_AFTER - $BAT_BEFORE" | bc` SECONDS=`echo "$DATE_AFTER - $DATE_BEFORE" | bc` USAGE=`echo "($DIFF * 60 * 60) / ($SECONDS)" | bc` # output the results echo "before: $BAT_BEFORE mWh" >> $LOG echo "after: $BAT_AFTER mWh" >> $LOG echo "diff: $DIFF mWh" >> $LOG echo "seconds: $SECONDS sec" >> $LOG echo "result: $USAGE mW" >> $LOG if [ $USAGE -gt -$THRESHOLD ] then echo "Congratulations, your model seems NOT to be affected." >> $LOG else echo "Your model seems to be affected." >> $LOG fi if [ $SECONDS -lt 1200 ] then echo "!!! The notebook was suspended less than 20 minutes." >> $LOG echo "!!! To get representative values please let the notebook sleep" >> $LOG echo "!!! for at least 20 minutes." >> $LOG fi echo "" >> $LOG # restore USB support if !(lsmod | grep '^ehci_hcd') >/dev/null ; then /sbin/modprobe -s ehci_hcd fi if !(lsmod | grep '^uhci_hcd') >/dev/null ; then /sbin/modprobe -s uhci_hcd fi if !(lsmod | grep '^usbhid') >/dev/null ; then /sbin/modprobe -s usbhid fi # restore system time |
Quellcode |
|
1 2 |
env USER=root echo mem > /sys/power/state bash: /sys/power/state: Permission denied |
Quellcode |
|
1 |
for i in /etc/acpi/actions/*; do echo $i; cat $i; echo -e "\n====\n"; done |
Quellcode |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
#!/bin/bash # Anfang der Konfiguration RUNLEVEL_AC="default" RUNLEVEL_BATTERY="battery" # Ende der Konfiguration if [ ! -d "/etc/runlevels/${RUNLEVEL_AC}" ] then logger "${0}: Runlevel ${RUNLEVEL_AC} does not exist. Aborting." exit 1 fi if [ ! -d "/etc/runlevels/${RUNLEVEL_BATTERY}" ] then logger "${0}: Runlevel ${RUNLEVEL_BATTERY} does not exist. Aborting." exit 1 fi if on_ac_power then if [[ "$(</var/lib/init.d/softlevel)" != "${RUNLEVEL_AC}" ]] then logger "Switching to ${RUNLEVEL_AC} runlevel" /sbin/rc ${RUNLEVEL_AC} fi elif [[ "$(</var/lib/init.d/softlevel)" != "${RUNLEVEL_BATTERY}" ]] then logger "Switching to ${RUNLEVEL_BATTERY} runlevel" /sbin/rc ${RUNLEVEL_BATTERY} fi |
Quellcode |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
#!/bin/sh # if launched through a lid event and lid is open, do nothing #echo "$1" | grep "button/lid" && grep -q open /proc/acpi/button/lid/LID/state && exit 0 # remove USB 1.1 driver rmmod uhci_hcd # sync filesystem and clock sync /sbin/hwclock --systohc # switch to console FGCONSOLE=`fgconsole` chvt 6 /usr/sbin/radeontool light off # go to sleep sleep 5 && echo -n "mem" > /sys/power/state # readjust the clock (it might be off a bit after suspend) /sbin/hwclock --adjust /sbin/hwclock --hctosys # reload USB 1.1 driver modprobe uhci_hcd # turn on the backlight and switch back to X radeontool light on chvt $FGCONSOLE |
Quellcode |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 |
TERM=xterm SHELL=/bin/bash DEFAULTLEVEL=default USER=root PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/sbin:/sbin:/bin:/usr/sbin:/usr/bin _=/bin/env PWD=/ BOOTLEVEL=boot SVCNAME=acpid CONSOLETYPE=pty SHLVL=3 HOME=/root SOFTLEVEL=default |
Quellcode |
|
1 |
/etc/acpi/actions/sleep.sh: line 22: echo: write error: Operation not permitted |