2008/6/29 Paolo <[EMAIL PROTECTED]>: > On Sun, Jun 29, 2008 at 03:28:28PM +0300, Dotan Cohen wrote: > >> 1) Find out what ACPI event (lid switch or power button) caused the >> system to wake? > > keep acpi_listen running in a terminal >
Thanks. >> 2) Find out how much time the laptop has been running since wake (not >> uptime, which is the time from boot)? > > enclose the s2ram command (likely run by some script in /etc/acpi/) in > 2 marker commands, eg > > ! logger -t acpi_s2ram === going to sleep === > ! <suspend command> > ! logger -t acpi_s2ram === got a wake up === > > in case you're seen clock troubles, log an hw timestamp as well, like: > > ! logger -t acpi_s2ram === going to sleep (`hwclock`) === > Well, I'd rather avoid playing with system files. Is there a trigger that I can use to run a script when the laptop wakes? I could run a script which does no more than record the current timestamp. Then, when I discover that the machine is running, I can compare the current unixtime with the timestamp that was written when the machine woke. >> 3) Configure the laptop to poll the lid switch and return to RAM > > hardly reliable, you risk sudden shutdown while working... better figure out > what's wrong, and use s2disk meanwhile. > I would only run the script upon wake, like the script I just mentioned in point 2. Thanks. Dotan Cohen http://what-is-what.com http://gibberish.co.il א-ב-ג-ד-ה-ו-ז-ח-ט-י-ך-כ-ל-ם-מ-ן-נ-ס-ע-ף-פ-ץ-צ-ק-ר-ש-ת A: Because it messes up the order in which people normally read text. Q: Why is top-posting such a bad thing?