How does s2ram/s2disk work?   where is the initialization point for each, are they identical?   and how does it differ from reboot?   or warm restart?   There should be no BIOS coming in between, right?

http://fixunix.com/slackware/532515-pppoe-session-s2ram.html

pppoe session and s2ram

This is a discussion on pppoe session and s2ram within the Slackware forums, part of the Help category; When I resume after s2ram (suspend to ram) my pppoe connection is down. I'd like to be able to run '/etc/rc.d/rc.pppoe restart' after resume. I create /etc/acpi/pppoe-restore.sh $ cat pppoe-restore.sh ...



Default pppoe session and s2ram

When I resume after s2ram (suspend to ram) my pppoe connection is down.
I'd like to be able to run '/etc/rc.d/rc.pppoe restart' after resume. I
create /etc/acpi/pppoe-restore.sh

$ cat pppoe-restore.sh
#!/bin/sh
/etc/rc.d/rc.pppoe restart
sleep 1
/usr/sbin/ntpdate be.pool.ntp.org nl.pool.ntp.org fr.pool.ntp.org

and call a script from /etc/acpi/acpi_handler.sh

$ cat acpi_handler.sh
#!/bin/sh
# Default acpi script that takes an entry for all actions

IFS=${IFS}/
set $@

case "$1" in
button)
case "$2" in
# power) /sbin/init 0
power) /etc/acpi/pppoe-restore.sh
;;
*) logger "ACPI action $2 is not defined"
;;
esac
;;
*)
logger "ACPI group $1 / action $2 is not defined"
;;
esac

In order to machine sleep I press 'sleep'-button on multimedia keyboard,
in order to wake I press power-button on system block.
But it does not work (pppoe does not restart). What I am doing wrong?

Thanks,

--
Murat D. Kadirov
Reply With Quote
  #2  
Old 09-11-2008, 03:03 PM
Default Re: pppoe session and s2ram

On 2008-09-11, Murat D. Kadirov wrote:
> When I resume after s2ram (suspend to ram) my pppoe connection is down.
> I'd like to be able to run '/etc/rc.d/rc.pppoe restart' after resume. I
> create /etc/acpi/pppoe-restore.sh
>
> $ cat pppoe-restore.sh
> #!/bin/sh
> /etc/rc.d/rc.pppoe restart
> sleep 1
> /usr/sbin/ntpdate be.pool.ntp.org nl.pool.ntp.org fr.pool.ntp.org
>
> and call a script from /etc/acpi/acpi_handler.sh
>
> $ cat acpi_handler.sh
> #!/bin/sh
> # Default acpi script that takes an entry for all actions
>
> IFS=${IFS}/
> set $@
>
> case "$1" in
> button)
> case "$2" in
> # power) /sbin/init 0
> power) /etc/acpi/pppoe-restore.sh
> ;;
> *) logger "ACPI action $2 is not defined"
> ;;
> esac
> ;;
> *)
> logger "ACPI group $1 / action $2 is not defined"
> ;;
> esac
>
> In order to machine sleep I press 'sleep'-button on multimedia keyboard,
> in order to wake I press power-button on system block.
> But it does not work (pppoe does not restart). What I am doing wrong?



Disclaimer: I *think* this is how the kernel's suspend/resume works,
but I'm not entirely sure...

Assuming your "sleep" button calls /etc/acpi/actions/suspend.sh,
make your suspend.sh script look something like this:

#!/bin/sh

sync # Sync everything to be sure

# Do any pre-suspend stuff needed
# For example, /etc/acpi/pppoe-stop.sh

# Do the actual suspend operation
echo -n mem > /sys/power/state

# When the system wakes up, stuff after the suspend operation should
# be run, so add them here...
/etc/acpi/pppoe-restore.sh

# End of script

Let me know if that works and I'll document it better somewhere :-)

-RW
Reply With Quote
  #3  
Old 09-11-2008, 04:44 PM
Default Re: pppoe session and s2ram

Murat D. Kadirov wrote:
> When I resume after s2ram (suspend to ram) my pppoe connection is down.
> I'd like to be able to run '/etc/rc.d/rc.pppoe restart' after resume. I
> create /etc/acpi/pppoe-restore.sh
>
> $ cat pppoe-restore.sh
> #!/bin/sh
> /etc/rc.d/rc.pppoe restart
> sleep 1
> /usr/sbin/ntpdate be.pool.ntp.org nl.pool.ntp.org fr.pool.ntp.org
>
> and call a script from /etc/acpi/acpi_handler.sh
>
> $ cat acpi_handler.sh
> #!/bin/sh
> # Default acpi script that takes an entry for all actions
>
> IFS=${IFS}/
> set $@
>
> case "$1" in
> button)
> case "$2" in
> # power) /sbin/init 0
> power) /etc/acpi/pppoe-restore.sh
> ;;
> *) logger "ACPI action $2 is not defined"
> ;;
> esac
> ;;
> *)
> logger "ACPI group $1 / action $2 is not defined"
> ;;
> esac
>
> In order to machine sleep I press 'sleep'-button on multimedia keyboard,
> in order to wake I press power-button on system block.
> But it does not work (pppoe does not restart). What I am doing wrong?
>
> Thanks,
>

If it works like my 2 laptops, the power button event gets sent before
the suspend. You need to hook into the suspend script. For example, I
need to kill wireless upon suspend, & restart it when I resume.
My power button event calls the suspend script, in the suspend script
I kill wpa_supplicant, suspend (to disk or ram), restart
wpa_supplicant.

Jerry
Reply With Quote
  #4  
Old 09-11-2008, 07:01 PM
Default Re: pppoe session and s2ram

On Thu, 11 Sep 2008 09:31:48 +0000 (UTC), "Murat D. Kadirov" wrote:

>When I resume after s2ram (suspend to ram) my pppoe connection is down.
>I'd like to be able to run '/etc/rc.d/rc.pppoe restart' after resume. I
>create /etc/acpi/pppoe-restore.sh
>
>$ cat pppoe-restore.sh
>#!/bin/sh
>/etc/rc.d/rc.pppoe restart
>sleep 1
>/usr/sbin/ntpdate be.pool.ntp.org nl.pool.ntp.org fr.pool.ntp.org


For starters, this is not a good sequence, you need to kick pppoe
and wait for the if-up (etc/ppp/if-up) script to be called to do
the stuff needs doing once you _have_ the ppp connection established.

Waiting only a second is unlikely to cut it.

It's not really a restart -- all real-time operations like network
connections go out the window when you stop the CPU. You need to
think in terms of a new startup for the pppoe, and stopping it
cleanly before stopping CPU.

Also the wrong way to run ntp, but that's a separate issue
>
>and call a script from /etc/acpi/acpi_handler.sh


I don't do s2{ram,disk} so clueless about the rest of your issue

Grant.
--
http://bugsplatter.id.au/
Reply With Quote
  #5  
Old 09-11-2008, 11:20 PM
Default Re: pppoe session and s2ram

On 2008-09-11, Robby Workman wrote:
>
> Disclaimer: I *think* this is how the kernel's suspend/resume works,
> but I'm not entirely sure...
>
> Assuming your "sleep" button calls /etc/acpi/actions/suspend.sh,
> make your suspend.sh script look something like this:
>
> #!/bin/sh
>
> sync # Sync everything to be sure
>
> # Do any pre-suspend stuff needed
> # For example, /etc/acpi/pppoe-stop.sh
>
> # Do the actual suspend operation
> echo -n mem > /sys/power/state
>
> # When the system wakes up, stuff after the suspend operation should
> # be run, so add them here...
> /etc/acpi/pppoe-restore.sh
>
> # End of script
>
> Let me know if that works and I'll document it better somewhere :-)



Update: I've just tested this and confirmed that it does work.
I've updated my sample acpi stuff for suspend/resume - it's at
http://rlworkman.net/conf/acpi/

-RW
Reply With Quote


Reply via email to