You are not logged in.

#1 2005-06-02 02:38:25

From: New York, NY
Registered: 2005-01-22
Posts: 404

suspend to ram -- wake up issue

I got my computer to go to sleep ok when I shut the lid but it's having some issues waking up.  When it wakes up I can get back to X and type some commands but something is not right and I can't pinpoint it.  For instance the terminal window will freeze on issuing a ping command.  The most obvious sign something is amiss is when I try to edit the suspend to ram script I have.  I get this message:

Found a swap file by the name "/usr/sbin/.susp2ram.swp"
          owned by: root   dated: Wed Jun  1 19:08:08 2005
         file name: /usr/sbin/susp2ram
          modified: no
         user name: root   host name: spycamera
        process ID: 4021
While opening file "/usr/sbin/susp2ram"
             dated: Wed Jun  1 19:21:28 2005
      NEWER than swap file!

(1) Another program may be editing the same file.
    If this is the case, be careful not to end up with two
    different instances of the same file when making changes.
    Quit, or continue with caution.

(2) An edit session for this file crashed.
    If this is the case, use ":recover" or "vim -r /usr/sbin/susp2ram"
    to recover the changes (see ":help recovery").
    If you did this already, delete the swap file "/usr/sbin/.susp2ram.swp"
    to avoid this message.

Swap file "/usr/sbin/.susp2ram.swp" already exists!
[O]pen Read-Only, (E)dit anyway, (R)ecover, (Q)uit, (A)bort, (D)elete it:

Something must be amiss somewhere but I don't know where...  Here is the script:

# Suspen-to-RAM script for IBM x41 and Arch Linux

# --------Suspend ----------

# Stop networking
/etc/rc.d/network stop

# Unload network drivers
modprobe -r ieee802111_crypt
modprobe -r ieee80211
modprobe -r ipw2200
modprobe -r tg3

# Suspend to RAM
echo mem > /sys/power/state

# --------Resume -----------

# Reset the hard disk, otherwise it is not accessible
hdparm -y /dev/sda

# Configure the drive (32-bit IO, UDMA,umaskirq)
#hdparm -c3 -d1 -u1 /dev/sda

#Switch virutal terminal to wake graphics up
chvt 1
chvt 7

# Start Networking
modprobe tg3
modprobe ipw2200
modprobe ieee80211
modprobe ieee80211_crypt

/etc/rc.d/network start

exit 0

Note that I know I'm using /dev/sda -- I don't have a /dev/hda on my laptop for some reason. (Thinkpad X41)  Also, the second hdparm line is disabled on purpose since those commands aren't supported by the sda drive.


#2 2005-06-02 10:24:34

Registered: 2004-02-04
Posts: 1,185

Re: suspend to ram -- wake up issue

The following is from rc.sysinit, I think you need to do something similar in your script:

stat_busy "Configuring System Clock"
if [ "$HARDWARECLOCK" = "UTC" ]; then
    /sbin/hwclock --utc --hctosys
    /sbin/hwclock --localtime --hctosys
if [ ! -f /var/lib/hwclock/adjtime ]; then
    echo "0.0 0 0.0" > /var/lib/hwclock/adjtime
if [ "$TIMEZONE" != "" ]; then
    /bin/ln -sf /usr/share/zoneinfo/$TIMEZONE /etc/localtime


#3 2005-06-02 16:36:51

Registered: 2005-01-19
Posts: 637

Re: suspend to ram -- wake up issue

Why don't you use the hibernate scripts?


#4 2005-06-03 14:25:09

From: New York, NY
Registered: 2005-01-22
Posts: 404

Re: suspend to ram -- wake up issue

i3989: I'm not sure what the purpose of adding that to the script would be..  My feeling is that something is remaining suspended after I resume.  I have to manually change terminals to VT7 even though I have that /usr/bin/chvt 7 line.

big_gie: I'm not familiar with those scripts -- can you point me to them?


#5 2005-06-03 23:10:29

Forum Fellow
From: Melbourne, Australia
Registered: 2004-10-09
Posts: 4,927

Re: suspend to ram -- wake up issue

hit their download page and grab their scripts.

They are oriented towards software suspend2 but they include options to suspend with suspend to ram instead.


#6 2005-06-15 15:59:34

Registered: 2005-01-19
Posts: 637

Re: suspend to ram -- wake up issue

There is a PKGBUILD somewhere on the forum I think. Could be usefull.


Board footer

Powered by FluxBB