Skip to contentSkip to conversation

How to wait that the machine resume in a script

DISCUSSION Olive 3 participants 3 messages Nov 16, 2005 – Nov 17, 2005 ACPI

lore
Share & tools
lore

Olive

author
#0 lore raw

Hello,

I just test acpi and it appears to have behave properly. I would like to
know via a script that the machine has been resumed. Something like

echo -n disk /sys/power/state
waitresumed
continue with the script

The naive solution to wait until "echo -n disk /sys/power/state" returns do not work because it returns too quicly.

Olive

-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc. Get Certified Today Register for a JBoss Training Course. Free Certification Exam for All Training Attendees Through End of 2005. For more info visit:
http://ads.osdn.com/?ad_id=7628&alloc_id=16845&op=click

#1 lore raw

Hello,

Quoted 6 lines

echo -n disk /sys/power/state
waitresumed
continue with the script

The naive solution to wait until "echo -n disk /sys/power/state" returns do not work because it returns too quicly.

Do you mean "echo -n disk > /sys/power/state"? This works correctly for me with suspend to ram ("echo mem > /sys/power/state").
How much too fast does it return? What about using a sleep 1 after the echo call?

-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc. Get Certified Today Register for a JBoss Training Course. Free Certification Exam for All Training Attendees Through End of 2005. For more info visit:
http://ads.osdn.com/?ad_id=7628&alloc_id=16845&op=click

#2 lore raw
In reply to Olive
Quoted 11 lines · Olive

Hello,

I just test acpi and it appears to have behave properly. I would like to
know via a script that the machine has been resumed. Something like

echo -n disk /sys/power/state
waitresumed
continue with the script

The naive solution to wait until "echo -n disk /sys/power/state" returns do not work because it returns too quicly.

Really? It should not... it can not. When machine is suspended, script can't run...
Pavel

Signature · 8 lines
Thanks, Sharp!


-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.  Get Certified Today
Register for a JBoss Training Course.  Free Certification Exam
for All Training Attendees Through End of 2005. For more info visit:
http://ads.osdn.com/?ad_id=7628&alloc_id=16845&op=click