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
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
|
 09-11-2008, 03:03 PM
|
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
|
 09-11-2008, 04:44 PM
|
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
|
 09-11-2008, 11:20 PM
|
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
|
|