Need Help Fixing Suspend to RAM

Hi all!
I’m trying to make “Suspend to RAM” work on my system. Actually, I am very close - just need some help as this is my first week using Linux.
When I click the “Leave” button, it gives me options for restart, shutdown, suspend to disk, and suspend to ram. Everything works except suspend to ram, which is unresponsive. If I go to a terminal window, I can use s2ram -f to force it into sleep, which works perfectly. I left it overnight and came back, woke it up and got to work. (This is a minor miracle for me, since I cannot do this on the same machine under Vista 64, which BSODs after a few minutes on resume from S3 sleep mode.)
So I made a little file called sleep which just has the command “sudo s2ram -f”. I can run this from the terminal window, but can’t figure out how to make the desktop shortcut of the file self-execute. But in any case, I would like to make the “Suspend to RAM” button on the “Leave” options to work correctly. Can anyone help me get these things working?
Thanks in advance.

btw, I’m using KDE 4.0

System specs:
Gigabyte GA-P45-DS3L (BIOS F7)
E7200 Core2Duo 2.53Ghz 1066Mhz FSB 3MB L2 (OC to 3.2Ghz)
SuperTalent 2x2G DDR2-800 PC6400 CL 5-5-5-15 (T800UX4GC5)
Seagate 500GB SATA2 7200 32mb HD
EVGA 8800GT 512MB Superclocked Edition
Ultra X-connect X2 550-watt PSU
Vista x64 SP1 and OpenSUSE 11.0

This is a known issue and we had lots of threads defocussing it. Your computer is not in the whilelist, so you have to use the force option. Read this thread to find out how you can configure your computer to make s2ram to work.

Yes, suspend seems to work fine for me with s2ram -f. What I’m trying to find out is, optimally, how do I fix the button from the KDE menu so that it issues the command correctly, or, sub-optimally, how do I create a batch file or equivalent that I can run from an icon on the desktop?

Make a text file called ‘config’ located at /etc/pm/config.d/ with the string ‘s2ram-f’. You can do this with your favourite text editor as root. After this you can configure KPowersave (assuming KDE) to suspend to ram when the lid closes etc.

I’m afraid I’m running into more fundamental Linux challenges…
How do I get my config file into that folder? If I try to move the file in Dolphin, it gives me an “access denied” error. Same problem if I save from Kwrite.

Thats why you need to be root first. Many experienced users prefer a CLI editor like vi or pico. Open a console and try

sudo kwrite /etc/pm/config.d/config

This will create the file for you at the correct location as root user.

Actually, I’m not sure it can be done with kwrite like this now (was ok in earlier opensuse versions) due to X-server configuration. I just tried it with this result:

dean@linux:~> sudo kwrite /etc/pm/config.d/config
root’s password:
kwrite: cannot connect to X server
dean@linux:~>

Instead, I suggest you download nano or pico via yast software manager first. Then from a console:

su (to become root)
pico /etc/pm/config.d/config (favourite editor)

Actually, I figured out how to do it by using a the run command and issuing “kdesu kwrite”, which allowed me to save the config file to the proper folder…
However, now my system is completely hosed…
I used kpowersave’s suspend to RAM option, and the system went to sleep. When I tried to bring it back from sleep, it comes up with some text, and then puts the system right back to sleep. No end to this cycle. So I reboot the system and go into SUSE, but as soon as the desktop is about to load, it goes to sleep! So now I’m really stuck!!

Update…
Well, I booted into failsafe mode, and even then the system was flickering back and forth between the desktop and the black screen with a bunch of text. Somehow I managed to get a terminal window open, then went and deleted the config file. Also stopped Kpowersave from starting at boot. So now I’m back to where I was when I started this post…but at least my system is working again!
Ok, any ideas what happened and how to move forward?

Do you have KDE 4.0 or 4.1? My desktop environment is KDE 3.5.9. KDE 4 looks better, but not yet mature and stable enough. Did you try KDE 3.5? You can have both together.

Let us know exactly what code was in your configuration file and what video and wireless card you have as I am not quite sure of it.

Sorry, I made a mistake with the config string I gave you, (based on the successful suspend command you were able to invoke). It should be:

S2RAM_OPTS="-f"

This is the suspend option I use with my ThinkPad. But have a good read of this guide first.

If you have further problems after suspending or resuming, then have a look at /var/log/pm-suspend.log for any error messages.

No worries, Deano…I’m having fun experimenting and learning, so I expect there will be some catastrophes. And things are back to nominal now.
I’ll try that string later today and let you know, and will for sure read through the whole guide, as I have only seen bits and parts of it.
-MXC

With the S2RAM_OPTS="-f" statement in the config file, the system goes to sleep properly, but upon awakening, it hangs when I start Firefox (hangs means screen freezes and system is totally unresponsive). It could be more than Firefox, but that is what appears to be the issue after a couple tries. When I issued s2ram -f from the console window, I was able to sleep and resume and to all my normal work for hours with no apparent problem, so it’s strange that it is causing a problem now. I also configured kpowersave again. Need to do more testing, but perhaps someone can weigh in on what might be going wrong.

I don’t think kpowersave is causing any problem. You might want to try other force options. You’ll find all the options in detail at ‘Pm-utils’.

You also might have to do some more configuration for video card. It could take sometime to make it work properly.

Yeah, but what’s strange is that s2ram -f works fine when issued from a terminal window…system comes back and all apps appear to work properly. So why is it different when S2RAM_OPTS="-f" appears in the config file in etc/pm/config.d?

From the terminal window the system shows:

linux-fj53:/home/MXC # s2ram -f
Switching from vt7 to vt1
fbcon fb0 state 1
fbcon fb0 state 0
switching back to vt7
linux-fj53:/home/MXC #

…and works fine coming back from suspend to RAM. Why can’t I replicate this behavior with the Menu Buttons? Or with KPowersave’s “Suspend to RAM” option?

your wireless card may not be resuming for you when you come back up and that is why Firefox is giving you trouble.

For my card running on the madwifi driver I had to add a file so my wireless card could resume after suspension

If you have Intel wireless that my not be an issue.

If it is an Atheros wireless running on Madwifi it can be something to look into

Again, the issue is that it works fine from a console window using the s2ram -f command. It only fails when I try to use the buttons on KDE.
Anyway, I don’t have a wireless card.

Have a look at the pm logs:

cat /var/log/pm-suspend.log

Maybe it will give an indication of what the resume issue is.

Sun Aug 17 18:33:23 PDT 2008: running suspend hooks.
===== Sun Aug 17 18:33:23 PDT 2008: running hook: /usr/lib/pm-utils/sleep.d/00clear =====
===== Sun Aug 17 18:33:23 PDT 2008: running hook: /usr/lib/pm-utils/sleep.d/01logging =====
suspend initiated: Sun Aug 17 18:33:23 PDT 2008

Module Size Used by
af_packet 42624 0
joydev 30848 0
snd_pcm_oss 68992 0
snd_mixer_oss 35584 1 snd_pcm_oss
snd_seq 83600 0
snd_seq_device 26516 1 snd_seq
iptable_filter 20736 0
ip_tables 39056 1 iptable_filter
ip6table_filter 20608 0
ip6_tables 40720 1 ip6table_filter
x_tables 43144 2 ip_tables,ip6_tables
ipv6 331544 20
cpufreq_conservative 26248 0
cpufreq_userspace 23556 0
cpufreq_powersave 18816 0
acpi_cpufreq 27536 0
microcode 32808 0
firmware_class 27776 1 microcode
binfmt_misc 30220 1
fuse 72256 3
loop 37508 0
dm_mod 88600 0
snd_hda_intel 497452 2
snd_pcm 115208 2 snd_pcm_oss,snd_hda_intel
snd_timer 45072 2 snd_seq,snd_pcm
rtc_cmos 28728 0
ppdev 26504 0
snd_page_alloc 28688 2 snd_hda_intel,snd_pcm
i2c_i801 27804 0
r8169 51204 0
parport_pc 59592 0
sr_mod 35764 0
rtc_core 41012 1 rtc_cmos
button 27040 0
snd_hwdep 28424 1 snd_hda_intel
nvidia 8165472 34
parport 60448 2 ppdev,parport_pc
rtc_lib 20224 1 rtc_core
cdrom 53416 1 sr_mod
i2c_core 45344 2 i2c_i801,nvidia
r8168 56080 0
snd 96248 12 snd_pcm_oss,snd_mixer_oss,snd_seq,snd_seq_device,snd_hda_intel,snd_pcm,snd_timer,snd_hwdep
soundcore 26000 1 snd
floppy 83048 0
sg 56912 0
sd_mod 47280 5
ehci_hcd 56204 0
uhci_hcd 43936 0
usbcore 188376 3 ehci_hcd,uhci_hcd
edd 28176 0
ext3 170896 2
mbcache 27396 1 ext3
jbd 82368 1 ext3
fan 23944 0
thermal 44448 0
processor 72668 4 acpi_cpufreq,thermal
ata_piix 43396 4
pata_jmicron 23808 0
libata 195104 2 ata_piix,pata_jmicron
scsi_mod 195032 4 sr_mod,sg,sd_mod,libata
dock 29344 1 libata

         total       used       free     shared    buffers     cached

Mem: 4060384 623668 3436716 0 17544 276292
-/+ buffers/cache: 329832 3730552
Swap: 2104472 0 2104472

===== Sun Aug 17 18:33:23 PDT 2008: running hook: /usr/lib/pm-utils/sleep.d/05led =====
===== Sun Aug 17 18:33:23 PDT 2008: running hook: /usr/lib/pm-utils/sleep.d/06autofs =====
===== Sun Aug 17 18:33:23 PDT 2008: running hook: /usr/lib/pm-utils/sleep.d/10NetworkManager =====
===== Sun Aug 17 18:33:23 PDT 2008: running hook: /usr/lib/pm-utils/sleep.d/20reset-bluetooth =====
===== Sun Aug 17 18:33:23 PDT 2008: running hook: /usr/lib/pm-utils/sleep.d/30s2disk-check =====
===== Sun Aug 17 18:33:23 PDT 2008: running hook: /usr/lib/pm-utils/sleep.d/45pcmcia =====
===== Sun Aug 17 18:33:23 PDT 2008: running hook: /usr/lib/pm-utils/sleep.d/50modules =====
===== Sun Aug 17 18:33:23 PDT 2008: running hook: /usr/lib/pm-utils/sleep.d/55battery =====
===== Sun Aug 17 18:33:23 PDT 2008: running hook: /usr/lib/pm-utils/sleep.d/80acpi-fan =====
===== Sun Aug 17 18:33:23 PDT 2008: running hook: /usr/lib/pm-utils/sleep.d/80videobios =====
===== Sun Aug 17 18:33:23 PDT 2008: running hook: /usr/lib/pm-utils/sleep.d/94cpufreq =====
===== Sun Aug 17 18:33:23 PDT 2008: running hook: /usr/lib/pm-utils/sleep.d/95led =====
===== Sun Aug 17 18:33:23 PDT 2008: running hook: /usr/lib/pm-utils/sleep.d/99Zgrub =====
===== Sun Aug 17 18:33:23 PDT 2008: running hook: /usr/lib/pm-utils/sleep.d/99info =====
Sun Aug 17 18:33:23 PDT 2008: done running suspend hooks.

  • /usr/sbin/s2ram -f
    Switching from vt7 to vt1
    fbcon fb0 state 1
    fbcon fb0 state 0
    switching back to vt7
  • RET=0
  • set +x
    Sun Aug 17 18:46:52 PDT 2008: running resume hooks.
    ===== Sun Aug 17 18:46:52 PDT 2008: running hook: /usr/lib/pm-utils/sleep.d/99info =====
    ===== Sun Aug 17 18:46:52 PDT 2008: running hook: /usr/lib/pm-utils/sleep.d/99Zgrub =====
    ===== Sun Aug 17 18:46:52 PDT 2008: running hook: /usr/lib/pm-utils/sleep.d/95led =====
    ===== Sun Aug 17 18:46:52 PDT 2008: running hook: /usr/lib/pm-utils/sleep.d/94cpufreq =====
    ===== Sun Aug 17 18:46:52 PDT 2008: running hook: /usr/lib/pm-utils/sleep.d/80videobios =====
    ===== Sun Aug 17 18:46:52 PDT 2008: running hook: /usr/lib/pm-utils/sleep.d/80acpi-fan =====
    ===== Sun Aug 17 18:46:52 PDT 2008: running hook: /usr/lib/pm-utils/sleep.d/55battery =====
    ===== Sun Aug 17 18:46:52 PDT 2008: running hook: /usr/lib/pm-utils/sleep.d/50modules =====
    ===== Sun Aug 17 18:46:52 PDT 2008: running hook: /usr/lib/pm-utils/sleep.d/45pcmcia =====
    ===== Sun Aug 17 18:46:52 PDT 2008: running hook: /usr/lib/pm-utils/sleep.d/30s2disk-check =====
    ===== Sun Aug 17 18:46:52 PDT 2008: running hook: /usr/lib/pm-utils/sleep.d/20reset-bluetooth =====
    ===== Sun Aug 17 18:46:52 PDT 2008: running hook: /usr/lib/pm-utils/sleep.d/10NetworkManager =====
    ===== Sun Aug 17 18:46:52 PDT 2008: running hook: /usr/lib/pm-utils/sleep.d/06autofs =====
    ===== Sun Aug 17 18:46:52 PDT 2008: running hook: /usr/lib/pm-utils/sleep.d/05led =====
    ===== Sun Aug 17 18:46:52 PDT 2008: running hook: /usr/lib/pm-utils/sleep.d/01logging =====
    ===== Sun Aug 17 18:46:52 PDT 2008: running hook: /usr/lib/pm-utils/sleep.d/00clear =====
    Sun Aug 17 18:46:52 PDT 2008: done running resume hooks.

Above is the .log file. I believe pm_utils does something that dorks up my system, whereas just issuing the basic s2ram -f works fine.
Does anyone know how to create a simple desktop configuration file that contains the command “sudo s2ram -f” that I can just click on the desktop and solve this problem once and for all???