Has anyone else found that upon resume, apmsleep (apmsleep is only called if you give the Z a "maximum sleep time" by puting a file in /etc/apm/wakeup.d) hangs for a while upon resume, which, in turn, causes matchbox to freeze?
I see it discussed in a few threads, but they all seem to indicate that it is fixed.
It doesn't seem to hang the system itslef, I can still SSH into it, and if I suspend from the console, the problem isn't even noticeable (though apmsleep is still hung in the background upon resume, it doesn't affect the console, only X). Also, all keystrokes are cached and as soon as apmsleep "let's go" they hit matchbox.
The only way out is to wait (up to 3 to 5 minutes it seems) after I resume or to SSH in and "kill -HUP" the apmlseep process, which unfreezes everything instantly.
Any idea what is causing this? Why does apmsleep hang upon resume, and why is X (or matchbox, I'm not sure where one ends and the other begins) held at a standstill by apmsleep, while everything in the background (network services, SSH, the console) are not?
What is really troublesome, is that it didn't seem to really start happening until after I installed ntpd. I removed ntpd, but the problem persists.
I had similar issues if I issued an ntpdate command from within X. The system would immediately suspend, and then, when I brougth it back up (if it didn't immediately suspend again) it woud hang for 3 to 5 minutes before becoming responsive.
Maybe apmsleep just has a very strong aversion to correct system time?
I tried putting a & at the end of the apmsleep line in /usr/bin/apm, which works well in console mode, allowing apm to finish upon resume, just leaving apmsleep in the background to do its thing or be killed later. However, if you suspend from within X, everything is in slow motion upon resume, with X taking up 99% of the CPU. X stays that way forever, long after apmsleep has finally gone away.
So, again, why won't apmsleep go away upon resume, and, regardless, why does X freeze until apmsleep goes away, while the console and background services keep on working fine?
Here is what I get if I put the --debug option onto apmsleep in the /usr/bin/apm file:
Good suspend resume cycle:
Current RTC time is 16:28:39.
Current local time is 11:28:38.
Setting RTC alarm time to 16:58:39.
RTC alarm time now set to 16:58:39.
Waiting until clock jumps
(system suspends)
(resume system with on/off button)
Time leap detected
Bad cycle (apmsleep hangs:
Current RTC time is 16:28:39.
Current local time is 11:28:38.
Setting RTC alarm time to 16:58:39.
RTC alarm time now set to 16:58:39.
Waiting until clock jumps
(system suspends)
(resume system with on/off button)
(apmsleep hangs for a while, hanging the apm script and X)
Time out -- no time leap happened
From reading the man page for apmsleep, it appears that the timeout is 60 seconds, so for some reason, sometimes when I manually resume, apmsleep gets the hint and takes that as a "time leap," but sometimes it doesn't take the hint, and just waits for a built in timeout. That is my guess anyway.