![]() |
APMD-List: |
to APMD Home
|
Index:
[thread]
[date]
[subject]
[author]
From: Craig Markwardt <craigm@pcasun3.gsfc.nasa.gov> To : Jamie Zawinski <jwz@jwz.org> Date: Tue, 25 May 1999 14:45:08 -0400 (EDT) Re: pre-suspend notifications?Jamie Zawinski writes: > Avery Pennarun wrote: > > > > You need to be root then, I think. Download the apmd source and see. It's > > pretty simple. > > Ok, it looks fairly simple. Is there a sensible reason why one must be > root to monitor the apm state? You don't have to be root to monitor the apm state, but you do have to be root to get apm events through /dev/apm. This is perhaps an overly simplified security model in the APM kernel module. I say you can monitor the APM state because you can check /proc/apm, which has some information. I submitted a patch to Stephen Rothwell that puts even more information there. Hopefully that or something like it appears soon. > I'm still kind of confused about how it works. If I'm listening for APM > events, does that mean that some other process cannot also be listening > for events? I want to make xscreensaver passively observe the apm > goings-on without influencing them. The kernel allows multiple user-level programs to monitor APM events, but xscreensaver may have to be root to do this. I agree that it would be desirable for user programs to get at this information without being root. The problem is that customers of /dev/apm also have the ability to trigger apm suspend and standby mode, which could be a security risk if everybody can do it. > I seem to have gotten something in my machine confused somehow; right > now (after having upgraded to apm 3.0b6) I can no longer suspend; > normally, either closing the lid or hitting Fn-F4 will suspend the > machine, but after having run apmd, it no longer does. Stopping apmd > doesn't make it start working again. When I attempt to suspend, the > machine keeps running, and after a while (30 seconds or so) makes the > beep-sound that it uses to mean "couldn't do that." (This is a Thinkpad > 770ED running RH 5.2 / kernel 2.0.36.) This may be a catch-22 situation. apmd calls sync(), syslog(), etc, and perhaps a call-out routine via the -s or -r options. This may activate the disk drive, and confuse your BIOS. After all, if your system is about to be suspended because of idleness, and suddenly the disk becomes active, the BIOS may decide to prevent the suspend. Some BIOSes are just plain non-standard. Can you flash an update? Good luck, Craig Index: [thread] [date] [subject] [author] |