Toshiba Tecra 8000 Suspend to RAM using ACPI on Fedora Core 2

From: Charles Curley (charlescurley_at_charlescurley.com)
Date: 10/10/04

  • Next message: Mike Klinke: "Re: text vs html posts on this list..."
    Date: Sat, 9 Oct 2004 19:25:58 -0600
    To: Toshiba Linux users <tlinux-users@tce.toshiba-dme.co.jp>, fedora-list@redhat.com, fedora-docs-list@redhat.com
    
    
    
    

    There I was, out in the Big Horn Mountains, with a bunch of GPS data
    on my Toshiba Tecra 8000, collected with GPSDrive
    (http://www.gpsdrive.cc/). I had just upgraded from Fedora Core 1 to
    Fedora Core 2 (FC2). I decided to take a break and enjoy the mountains
    around me in peace and quiet. I hit the power button, which on many
    Toshibas puts the machine into RAM suspension. Which used to put this
    machine into RAM suspension. Oops, it shut down instead, loosing my
    data. Arrgh!

    Well! I started doing a bit of research on ACPI
    (http://acpi.sourceforge.net/), the power management system in FC2,
    and John Belmonte's extension for Toshiba laptops
    (http://memebeam.org/toys/ToshibaAcpiDriver). That and some emails on
    the Toshiba Linux List
    (http://linux.toshiba-dme.co.jp/linux/index.htm), and I was able to
    put together what I needed.

    This script comes with absolutely nothing, not even a guarantee to be
    useful for wrapping fish.

    There are two gotchas.

    * MySQL on FC2 does not want to suspend to ram. The workaround is to
      shut it down prior to suspension and restart it afterwards. This has
      the added advantage that it forces MySQL to flush to disk.

    * My USB floppy drive looses its marbles briefly after powerup, but
      recovers. One workaround would be to shut down the USB driver, as
      Belmonte does in the script from which I cribbed, but this works
      well enough for me.

    You need two files. In /etc/acpi/events, put the file power.button,
    which looks like so:

    --------------------------------------------------
    # Power button instruction for ACPI.
     
    # Time-stamp: <2004-10-09 18:36:19 root power.button>
     
    event=button/power.*
    action=/etc/acpi/actions/power.button.sh
    --------------------------------------------------

    Actually you can call it anything you want, as long as it isn't a
    hidden file (the file name has a period as its first letter).

    In /etc/acpi/actions/, put the script power.button.sh, which looks
    like so:

    --------------------------------------------------
    # Run this script when the user hits the power button.
                                                                                    
    # Time-stamp: <2004-10-09 19:04:16 root power.button.sh>
                                                                                    
    # Check for hint to ignore power button. This is useful for wake from
    # suspend to RAM, etc. If we don't do this, the computer will cycle
    # through suspensions forever, or until it runs out of power. There
    # seems to be a debounce problem. From
    # http://memebeam.org/toys/ToshibaLibretto
                                                                                    
    POWER_IGNORE=/var/run/ignore_powerbtn
    if [ -f $POWER_IGNORE ]; then
        rm -f $POWER_IGNORE
        exit 0
    fi
     
     
    # MySQL-3.23.58-9 refuses to shut down. Well, we'll fix that!
     
    STATUS=`service mysqld status | grep -i running | cut -f1 -d' '`
     
    echo "mysqld status is: \"$STATUS\""
     
    # If the daemon is running, we shut it down.
     
    if [ ! -z $STATUS ]; then
     
        echo "Shutting down mysqld."
        service mysqld stop
     
     
        while ! service mysqld status | grep -i stopped ; do
            echo "Waiting...."
        done
     
    fi
     
    sync
     
    # So we know to ignore this script on the way back up...
    touch /var/run/ignore_powerbtn
    sleep 1
     
    # Do the deed...
    echo 3 > /proc/acpi/sleep
     
    sleep 4

    if [ ! -z $STATUS ]; then

        echo "Firing up mysqld."
        service mysqld start

        # Spin until the daemon is running.

        while ! service mysqld status | grep -i running ; do
            echo "Waiting on MySQL Start...."
        done

    fi
     
    exit 0

    --------------------------------------------------

    Rename to a hidden file or delete the sample.conf file in
    /etc/acpi/events.

    To make the change effective, run "service acpid restart".

    -- 
    Charles Curley                  /"\    ASCII Ribbon Campaign
    Looking for fine software       \ /    Respect for open standards
    and/or writing?                  X     No HTML/RTF in email
    http://www.charlescurley.com    / \    No M$ Word docs in email
    Key fingerprint = CE5C 6645 A45A 64E4 94C0  809C FFF6 4C48 4ECD DFDB
    
    

    
    

    -- 
    fedora-list mailing list
    fedora-list@redhat.com
    To unsubscribe: http://www.redhat.com/mailman/listinfo/fedora-list
    


  • Next message: Mike Klinke: "Re: text vs html posts on this list..."

    Relevant Pages

    • Re: Which Toshiba M55? S3292 or S139 at Office Depot?
      ... designed and built for Toshiba by Compal, and were significantly lower ... In this case - if Toshiba's specs are to be believed - the Celeron M ... 75w power supply. ...
      (comp.sys.laptops)
    • Town & Country suspension question
      ... Caravan SXT with the 4 liter/6 speed auto option. ... Can anyone tell me what the "Euro suspension" is and how it would ... We do have a power chair lift that is mounted in the3rd row seat area ...
      (rec.autos.makers.chrysler)
    • Re: Password not wanted
      ... So I pressed and held the power button for 5 or so seconds. ... (Somehow the Windows XP password didn't ... IIRC that's the Toshiba easy method. ... > could likely have pulled the battery and pressed/held the power ...
      (microsoft.public.windowsxp.customize)
    • Re: Sub resist load for speaker?
      ... >> Fred Bartoli wrote: ... It probably takes a heft bit of power to actually move ... >> the cone regardless of radiation. ... suspension elasticity to capacitance. ...
      (sci.electronics.design)
    • Re: Which Toshiba M55? S3292 or S139 at Office Depot?
      ... designed and built for Toshiba by Compal, and were significantly lower ... > In this case - if Toshiba's specs are to be believed - the Celeron M ... different power supplies or different chipsets (which would imply that ...
      (comp.sys.laptops)