I have installed Ubuntu 14.04 GNU/Linux on a MacBook Air (mid 2012).
I'm trying to use
rtcwake to implement a "delayed hibernation from suspend", as in https://askubuntu.com/a/33192 (the particular use case is not important here). But
rtcwake, issued e.g. as,
sudo rtcwake --seconds 120 --mode mem
enters suspend (
--mode mem) only for a few seconds (regardless of what the
--seconds option says) and immediately returns. Both suspend and hibernate work correctly on this system, e.g. when triggered by
pm-hibernate (using the kernel's
swsusp), or upon closing the lid. The machine keeps the time correctly and can show or update it in Ubuntu.
The same command works as expected on another (non-Apple) machine with a similar GNU/Linux OS.
I know MAC OS X has this kind of feature to wake up from sleep at a preset time or after a preset duration. So, I believe, they are accessing an internal clock. My questions are (all related):
Is there some wake-up event occurring behind the scenes that's triggering this immediate wake-up? I doubt this could be the culprit, since, as I mentioned above, the machine suspends correctly otherwise. (But then again, suspending correctly otherwise could be possibly due to the offending module(s) being removed by a
SUSPEND_MODULES hook before such "normal" suspend.) Also, the machine does not wake up from a normal suspend, triggered, e.g., by closing the lid, when a scheduled
rtcwake says it should.
If there aren't any "hidden" wake-up events, how do I use this internal clock to trigger a scheduled wake-up from suspend in GNU/Linux, since
rtcwake doesn't seem to be working? Is this clock RTC compatible to support standard driver model wakeup flags from a GNU/Linux tool? Are there any other methods/workarounds to achieve this result?