FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian Laptop

 
 
LinkBack Thread Tools
 
Old 06-29-2008, 12:28 PM
"Dotan Cohen"
 
Default Laptop waking up in bag

My Dell Inspiron laptop has a terrible habit of waking up from RAM
suspension inside my bag. I do not know if it is detecting a signal
from the lid switch or from the power button (these are the only two
ways that I know of to wake the laptop from RAM suspension). How can
I:
1) Find out what ACPI event (lid switch or power button) caused the
system to wake?
2) Find out how much time the laptop has been running since wake (not
uptime, which is the time from boot)?
3) Configure the laptop to poll the lid switch and return to RAM
suspension if the lid is shut (I'm not sure if this is possible).
Ideally this script would run 5 seconds after waking.

Thanks in advance.

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?
 
Old 06-29-2008, 01:06 PM
Paolo
 
Default Laptop waking up in bag

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

> 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`) ===

> 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.

HTH
--
paolo


--
To UNSUBSCRIBE, email to debian-laptop-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 06-29-2008, 02:30 PM
"Dotan Cohen"
 
Default Laptop waking up in bag

2008/6/29 Paolo <oopla@users.sf.net>:
> 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?
 
Old 06-29-2008, 06:30 PM
Heiner Markert
 
Default Laptop waking up in bag

Maybe your laptop wakes up if the battery becomes empty, in order to take some
action to save your data?

Regards
Heiner


Am Sonntag, 29. Juni 2008 14:28:28 schrieb Dotan Cohen:
> My Dell Inspiron laptop has a terrible habit of waking up from RAM
> suspension inside my bag. I do not know if it is detecting a signal
> from the lid switch or from the power button (these are the only two
> ways that I know of to wake the laptop from RAM suspension). How can
> I:
> 1) Find out what ACPI event (lid switch or power button) caused the
> system to wake?
> 2) Find out how much time the laptop has been running since wake (not
> uptime, which is the time from boot)?
> 3) Configure the laptop to poll the lid switch and return to RAM
> suspension if the lid is shut (I'm not sure if this is possible).
> Ideally this script would run 5 seconds after waking.
>
> Thanks in advance.
>
> 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?



--
To UNSUBSCRIBE, email to debian-laptop-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 06-29-2008, 06:55 PM
"Dotan Cohen"
 
Default Laptop waking up in bag

2008/6/29 Heiner Markert <mephisto@gmx.net>:
> Maybe your laptop wakes up if the battery becomes empty, in order to take some
> action to save your data?
>
> Regards
> Heiner
>

Interesting thought, but no, it wakes on a full charge as well as on a
partial charge.

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?
 
Old 06-29-2008, 11:00 PM
Paolo
 
Default Laptop waking up in bag

On Sun, Jun 29, 2008 at 05:30:16PM +0300, Dotan Cohen wrote:
> >
>
> 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

same as above then, wrap acpi_listen in a script, use option -c to make it
yield on 1 event, eg

! while true;do
! e=`acpi_listen -c 1`
! logger -t acpi-event "=== $e (`hwclock`) ==="
!# or simply write on terminal:
! echo "=== $e (`hwclock`) ==="
! done

likewise, another similar script in another terminal, running as simple
timestamper:

! while true;do
! logger -t timestamp "=== MARKER (`hwclock`) ==="
!# or simply write on terminal:
! echo "=== `date +%s` MARKER (`hwclock`) ==="
! sleep 5
! done

again, add `hwclock` if you suspect system-time skew.

HTH
--
paolo


--
To UNSUBSCRIBE, email to debian-laptop-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 06-30-2008, 10:09 AM
"Dotan Cohen"
 
Default Laptop waking up in bag

2008/6/30 Paolo <oopla@users.sf.net>:
> On Sun, Jun 29, 2008 at 05:30:16PM +0300, Dotan Cohen wrote:
>> >
>>
>> 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
>
> same as above then, wrap acpi_listen in a script, use option -c to make it
> yield on 1 event, eg
>
> ! while true;do
> ! e=`acpi_listen -c 1`
> ! logger -t acpi-event "=== $e (`hwclock`) ==="
> !# or simply write on terminal:
> ! echo "=== $e (`hwclock`) ==="
> ! done
>
> likewise, another similar script in another terminal, running as simple
> timestamper:
>
> ! while true;do
> ! logger -t timestamp "=== MARKER (`hwclock`) ==="
> !# or simply write on terminal:
> ! echo "=== `date +%s` MARKER (`hwclock`) ==="
> ! sleep 5
> ! done
>
> again, add `hwclock` if you suspect system-time skew.
>
> HTH


Thanks, Paolo. I have a little bash to learn before I am able to
implement that, but I will get on it.

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?
 
Old 06-30-2008, 02:04 PM
Paolo
 
Default Laptop waking up in bag

On Mon, Jun 30, 2008 at 01:09:03PM +0300, Dotan Cohen wrote:
>
> Thanks, Paolo. I have a little bash to learn before I am able to
> implement that, but I will get on it.

you're welcome - but no need to learn much just to run these tiny tests:
simply copy the programs into a couple of files - say /tmp/a and /tmp/b -
removing the leading '!'. Then (as root if you want to run hwclock as well)
run them in separate terminals with eg 'sh /tmp/a'.

--
paolo


--
To UNSUBSCRIBE, email to debian-laptop-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 06-30-2008, 06:21 PM
"Dotan Cohen"
 
Default Laptop waking up in bag

2008/6/30 Paolo <oopla@users.sf.net>:
> On Mon, Jun 30, 2008 at 01:09:03PM +0300, Dotan Cohen wrote:
>>
>> Thanks, Paolo. I have a little bash to learn before I am able to
>> implement that, but I will get on it.
>
> you're welcome - but no need to learn much just to run these tiny tests:
> simply copy the programs into a couple of files - say /tmp/a and /tmp/b -
> removing the leading '!'. Then (as root if you want to run hwclock as well)
> run them in separate terminals with eg 'sh /tmp/a'.
>

Thanks. I have the scripts running, as well as acpi_listen. Tomorrow I
will hopefully find out where the problem starts.

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?
 
Old 06-30-2008, 06:52 PM
"Dotan Cohen"
 
Default Laptop waking up in bag

2008/6/30 Andrew Smith <asmith@vtrl.co.uk>:
> Hi
> Please be aware that some Linux distributions are configured to
> clean,remove, files in /tmp, on booting, so don't put anything in /tmp you
> may want to keep.

Actually, I put them in ~/.bin/paulo_listener_acpi and
/.bin/paulo_timestamper

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?
 

Thread Tools




All times are GMT. The time now is 04:17 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org