# machine waking up randomly?

## eccerr0r

Just wondering if anyone has seen this happen:

Lately one of my Gentoo laptops have been draining its battery for some reason.  I couldn't figure out why but now I suspect somehow the RTC is waking up my laptop when it had been 'off' and draining the battery when I thought the machine should be completely off...  as in Shutdown-mode off.

Is this farfetched?  I'm not sure.  Twice when I checked this laptop's battery it was completely flat.  This shouldn't be the case for this few-month-old battery (I bought this in August...)

Anyone see this happening?  My /proc/driver/rtc looks like this as of right now...

```
rtc_time   : 02:07:35

rtc_date   : 2012-10-14

alrm_time   : 18:39:35

alrm_date   : 2012-10-14

alarm_IRQ   : yes

alrm_pending   : no

update IRQ enabled   : no

periodic IRQ enabled   : no

periodic IRQ frequency   : 1024

max user IRQ frequency   : 64

24hr      : yes

periodic_IRQ   : no

update_IRQ   : no

HPET_emulated   : yes

BCD      : yes

DST_enable   : no

periodic_freq   : 1024

batt_status   : okay

```

Does this mean the machine will wake up at 6:39PM today?  I don't think I set the alarm for then...  Not sure what's setting the alarm at all.

----------

## avx

 *Quote:*   

> rtc_time	: 14:35:26
> 
> rtc_date	: 2012-10-14
> 
> alrm_time	: 01:22:14
> ...

 Weird, I didn't set any rtc wakeups in the last ~year, still there's a value.

Got any fancy calendar solution running and some appointment somewhere near that time set?

----------

## DirtyHairy

I would wager that nothing happens unless alarm_pending is on (I also got a value for alarm_time there, and no mysterious wakeups). To be completely sure, you could doublecheck /var/log/messages and check whether there are any entries when the machine should have been off. If that's not the case, I would bet on hardware.

Weird suggestion: does anything rattle around inside your laptop when you shake it? I once accidently dropped my laptop and the edge hit the floor from about 30cm. No visible damage, but something rattled inside, and when I checked, the machine would behave strange, sometimes turning on, sometimes not. Turned out that a spring had disloged and was causing random short-circuits  :Smile: 

----------

## eccerr0r

I've not caught the machine turn on is the issue - by the time I check it again, the battery is flat down to where the power switch doesn't do anything.  I don't recall if the next time I try turning on the machine it needs to fsck or not.  What bothers me is that I would think Gnome should shut the laptop off when it has been idle, which it surely should be when sitting there...

I've not dropped the laptop yet so I hope there's nothing wrong with it...

----------

## javeree

A completely unrelated suggestion: is wake-on-lan off ? 

If your w-o-l mode is set to 'p', just having traffic on your ethernet line  may be sufficient to turn it on.

----------

## eccerr0r

Hmm... I was thinking about that, but I don't even have a LAN line connected to it, as it's a laptop it's usually on wireless.

----------

## avx

Longshot, but ok. What kind of laptop? Is it a somewhat recent Macbook (Air)? AFAIK they've got a firmware update to activate the 'power nap' feature on certain models. Could be activated by default after the update, OSX would shut it down again, but Gentoo can't.

Aside from that, got a cat? Moving my mouse wakes up the machine and we all no felines are of the stranger kind of living beings.

----------

## eccerr0r

Hmm... No, it's an HP Envy4.  I should check if there's a f/w update or not.  And no pets, I don't have a mouse (on that machine) either :)

----------

## eccerr0r

Aha.  Yes it did wake up unexpectedly from 'off' - I was messing with the 3.5.7 kernel update and installed it as a second option and shut it off for the night.  This morning I see the machine turned on, boot into the default option (old kernel).

I have a feeling it has something to do with the suspend/resume problem I've been having with the machine, I had not messed with suspend/resume in a while and I tried suspending the machine by mistake...  but I did shut it down after resume...

Weird.

Also pretty sure it's an RTC wakeup now.  What could be making it set the RTC to wake up?

----------

