Results 1 to 5 of 5

Thread: Configuring Suspend Scripts or Hooks

  1. #1

    Question Configuring Suspend Scripts or Hooks

    Is there anyone who can give a few pointers on how to go about controlling the Suspend/Wake process e.g. by using hooks. I know there are a few support pages on the site that refer to this but when it come to the details they are not as clear as they might be for someone new to Linux. (I assume that since 11.2 uses pm-utils the Powersave Project is not relevant to me, for example).

    Also any tips on restarting PCMCIA card services would be appreciated. Do I need to install pcmciautils?

    11.2 Gnome / Dell Inspiron 4100 laptop

    -

  2. #2

    Cool SOLVED: Re: Configuring Suspend Scripts or Hooks

    openSUSE is a good distribution (especially for a newbie like me) ..

    I installed the s2ram package called 'suspend' in openSUSE distro via a) webpin search and b) added the repository so I think it installed via yast

    Then as root I called s2ram Suspend to RAM - openSUSE

    I found with -n parameter that my machine not in database so I tried a --force which forced suspend to ram

    Getting it back up I had to hit the power button which worked.

    PCMCIA USB etc all fine

    Restarting internet required ifdown eth0
    then ifup eth0 (I am using ifup and not network manager (ref Network Settings)

    All I need now is to learn how to knock up some simple bash scripts and what to do with them and geronimo!!!

    Maybe I should attach the forced suspend to a key and also the ifdown/ifup commands to keys..
    -

  3. #3
    Chill Out NNTP User

    Default Re: Configuring Suspend Scripts or Hooks

    On Fri, 09 Apr 2010 09:36:01 +0000, smudgy wrote for a reply:

    > Is there anyone who can give a few pointers on how to go about
    > controlling the Suspend/Wake process e.g. by using hooks. I know there
    > are a few support pages on the site that refer to this but when it come
    > to the details they are not as clear as they might be for someone new to
    > Linux. (I assume that since 11.2 uses pm-utils the Powersave Project is
    > not relevant to me, for example).
    >
    > Also any tips on restarting PCMCIA card services would be appreciated.
    > Do I need to install pcmciautils?
    >
    > 11.2 Gnome / Dell Inspiron 4100 laptop
    >
    > -



    Would powersave work for you?

    code:
    -----------
    powersave -U
    -----------



    --
    Chill@opensuse.forum

  4. #4

    Default Re: Configuring Suspend Scripts or Hooks

    Quote Originally Posted by Chill Out View Post
    On Fri, 09 Apr 2010 09:36:01 +0000, smudgy wrote for a reply:
    Would powersave work for you?

    code:
    -----------
    powersave -U
    -----------


    --
    Chill@opensuse.forum
    I think powersave has been dropped in favour of pm-utils. Loses pcmcia with powersave -u and screen display still active

    suspend (s2ram) seems to be doing things for me but i need to configure it to show a login on wake among other things
    -

  5. #5

    Lightbulb SOLVED Re: Configuring Suspend Scripts or Hooks

    I have 2 routers and apparently all flavours and current versions of linux find this a problem.

    Computer(s) >> Local Safecom 4 Port Cable/DSL Broadband Router (e.g. for WAN sharing) >> ethernet/powerline >> Netgear Broadband Cable Modem Router >> ISP

    Both routers have NAT hardware firewall if that is relevant. Until I can figure out how to edit my config somewhere so that both routers and DNS etc are accommodated I have removed the local Safecom router which resolves the problem. Without the extra router I am now using Network Manager (or ifup if I want) and can suspend and hibernate without too much difficulty.

    One thing I have done is to add a command to a hook file called 99mylocal I created (and made executable) in /etc/pm/sleep.d to refresh the network. Here is the text of 99mylocal:

    Code:
    #!/bin/bash
    
    
    case $1 in
        hibernate)
            echo "Hibernating... suspending to Disk... ;>}"
    	echo "Unmounting external disks..."
    	umount -l  /dev/sdb1 /dev/sdc1 /dev/sdc2
    	echo "Taking eth0 down before hibernation..."
    	/sbin/ifdown eth0
    	;;
    
        suspend)
            echo "Suspending to RAM... ;>}"
    	echo "Unmounting external disks..."
    	umount -l  /dev/sdb1 /dev/sdc1 /dev/sdc2
    	echo "Taking down eth0 before suspend ..."
    	/sbin/ifdown eth0
            ;;
    
        thaw)
            echo "Suspend to disk is over, we are resuming..."
    	echo "Mounting disks..."
    	mount -a
    	echo "Renewing eth0 "
    	/sbin/rcnetwork restart
    	echo "network restarted"
            ;;
    
        resume)
            echo "Suspend to RAM seems to be over..."
    	echo "Mounting disks..."
    	mount -a
    	echo "Renewing eth0 "
    	/sbin/rcnetwork restart
    	echo "network restarted"
            ;;
    
        *)  echo "somebody is calling me totally wrong."
            ;;
    esac


    Without creating the hookfile I could get the same result by opening and then closing the Network Settings control panel in Yast after resuming from suspend or hibernate - since closing the cp runs rcnetwork restart

    smudger

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •