Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Slackware This Forum is for the discussion of Slackware Linux.


  Search this Thread
Old 03-11-2007, 04:12 AM   #1
Registered: Apr 2006
Location: lynnwood, wa - usa
Distribution: archlinux
Posts: 654

Rep: Reputation: 30
suspend to ram script, slack11 dell inspiron 8500

Having recently triumphed over my wirelss card (machine #1 in sig), many kudos to you helpful slackers, I decided to tackle ACPI sleep state 3.

Found an article and followed it. I had to insert some sudo commands (quite liberally) to get it to run without exiting due to permission errors.

As it is now:

# discover video card's ID
ID=`/sbin/lspci | grep VGA | awk '{ print $1 }' | sed -e 's@0000:@@' -e 's@:@/@'`

# securely create a temporary file
TMP_FILE=`mktemp /var/tmp/video_state.XXXXXX`
trap 'rm -f $TMP_FILE' 0 1 15

# switch to virtual terminal 1 to avoid graphics
# corruption in X
sudo chvt 1

# write all unwritten data (just in case)
sudo sync

# dump current data from the video card to the
# temporary file
cat /proc/bus/pci/$ID > $TMP_FILE

# suspend
sudo echo -n mem > sudo /sys/power/state

# restore video card data from the temporary file
# on resume
sudo cat $TMP_FILE > sudo /proc/bus/pci/$ID

# switch back to virtual terminal 7 (running X)
sudo chvt 7

# remove temporary file
sudo rm -f $TMP_FILE
the script runs without any reported errors.

however, all it does (visibly) is switch virtual terms and come right back to where I started from. With no button pushing whatsoever. The way I understood the above article was that the script would suspend to ram, then when the power button was pushed again, the rest of the script would restore.

I'm now thinking I need to link some event to the second half of the script? (after the # suspend comment)

I did try entering these commands (sans variables) as my normal self; at the:
sudo echo -n mem > sudo /sys/power/state
nothing really happend. is this the wrong command? (syntax?) the 'double' sudo thing got me around yet another permission error.

tips/clues/suggestions/canned script/personal experiences/tidbits/torrential downpour of pity for me being so blatantly incompetent?

all of the above are welcome yet not equally so

Old 03-11-2007, 11:53 AM   #2
Registered: Mar 2007
Distribution: Slackware
Posts: 264

Rep: Reputation: 68
I dont know exactly what you are trying to do but the this line looks wrong.
sudo echo -n mem > sudo /sys/power/state
I think it should be:
sudo echo -n "mem" > /sys/power/state
But thats about all I know to try maybe some other slacker has some better input.
Old 03-11-2007, 01:58 PM   #3
Registered: Apr 2006
Location: lynnwood, wa - usa
Distribution: archlinux
Posts: 654

Original Poster
Rep: Reputation: 30
thanks XGizzmo,

I tried your suggestion:

perry@hrgrv:~$ /usr/local/sbin/ 
/usr/local/sbin/ line 22: /sys/power/state: Permission denied
so I reinserted the 'sudo':
sudo echo -n "mem" > sudo /sys/power/state
but it does the same thing (just cycles through the chvt 1 -> 7 commands.

I am pretty sure you are correct that is the line & syntax that is screwed up, because that is where the actual suspend to ram should be happening. Unfortunately I can not seem to get permission to echo "" > /sys/power/state w/o root permissions.

<more info>

So as root I can use the command:
echo -n mem > /sys/power/state
and the computer suspends properly. however when I press the power button to bring it back up I just get a black screen. Which is what the second half of the script is for, to restore the video card.

as root then I can run the script. but I get the same behavior trying to restore the machine. so there are two problems.

1: can't do the command: sudo -n mem > /sys/power/state # because of permissions

2: can't be sure if the script is properly restoring the video card. I can be sure that if I run it as root it does _not_ restore properly.

any help as always greatly appreciated

Last edited by bioe007; 03-11-2007 at 02:16 PM.
Old 03-11-2007, 02:24 PM   #4
Registered: Apr 2006
Location: lynnwood, wa - usa
Distribution: archlinux
Posts: 654

Original Poster
Rep: Reputation: 30
also some more stuff..

after I have tried this script a couple times now images seem a bit 'wonky'..

lots of flickering and occasionally gkrellm charts appear in boxes being updated by firefox. so I exit fluxbox and see this:

Logging to: /home/perry/.fluxbox/log
BScreen::BScreen: managing screen 0 using visual 0x23, depth 24
wmsetbg warning: could not open domain file /home/perry/GNUstep/Defaults/WindowMaker
which: no wxdfast in (/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/usr/games:/opt/www/htdig/bin:/usr/lib/java/bin:/usr/lib/java/jre/bin:/opt/kde/bin:/usr/lib/qt/bin:/usr/share/texmf/bin:.)
which: no gwget in (/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/usr/games:/opt/www/htdig/bin:/usr/lib/java/bin:/usr/lib/java/jre/bin:/opt/kde/bin:/usr/lib/qt/bin:/usr/share/texmf/bin:.)
which: no d4x in (/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/usr/games:/opt/www/htdig/bin:/usr/lib/java/bin:/usr/lib/java/jre/bin:/opt/kde/bin:/usr/lib/qt/bin:/usr/share/texmf/bin:.)
which: no nt in (/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/usr/games:/opt/www/htdig/bin:/usr/lib/java/bin:/usr/lib/java/jre/bin:/opt/kde/bin:/usr/lib/qt/bin:/usr/share/texmf/bin:.)
which: no aria in (/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/usr/games:/opt/www/htdig/bin:/usr/lib/java/bin:/usr/lib/java/jre/bin:/opt/kde/bin:/usr/lib/qt/bin:/usr/share/texmf/bin:.)
Flushing about:blank about:config about:credits about:neterror about:plugins chrome: file:// file:// file:// file:// file:// file:// file:// file:// file:// file:// file:// file:// file:// file:// file:// file:// file:// file:// resource:xscreensaver: 10:18:15: SIGHUP received: restarting...
xscreensaver: 10:18:15: running as perry/users (1000/100)
and also find in my Xorg.0.log:

(WW) RADEON(0): Option "VBERestore" is not used
am I outta luck? or is there an alternative to VBERestore? i'll need to read more about that, but if anyone already knows....


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Fedora - Wireless not working on DELL Inspiron 8500 kenrowe Linux - Laptop and Netbook 7 03-12-2006 11:15 AM
Linspire on a Dell Inspiron 8500 notebook filterfann Linux - Laptop and Netbook 1 12-26-2005 02:35 PM
Best Distro for Dell Inspiron 8500 spage0506 Fedora 1 06-25-2005 06:30 PM
Fedora C2 + Dell Inspiron 8500 1920x1200 resolution big_gie Linux - Laptop and Netbook 6 07-18-2004 12:52 AM
Is about ACPI for Dell Inspiron 8500 laptop chico58 Linux - Software 1 11-28-2003 03:01 PM > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 08:58 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration