Subject: Re: Powerd(8) question
To: Brian Buhrow <buhrow@lothlorien.nfbcal.org>
From: Steven M. Bellovin <smb@cs.columbia.edu>
List: current-users
Date: 08/20/2007 09:42:14
On Sun, 19 Aug 2007 21:39:11 -0700
buhrow@lothlorien.nfbcal.org (Brian Buhrow) wrote:

> 	Hello folks.  I'm trying to use powerd(8) to get my laptop to
> sleep and wake gracefully when the cover is closed.
> When I close the lid, the /etc/powerd/scripts/lid_switch script gets
> called with the "pressed" argument as the second argument on the
> command line. However, it does not get called at all when the lid is
> re-opened. Does anyone else experience this, and, if so, what work
> arounds do you go through to get waking to happen?
> This is with 3.x userland, with a 4.0_BETA2 kernel from March 2007.
>
As I recall, what I did was to invoke my resume script from the
"pressed" section.  That is, the "pressed" section ultimately had a
sysctl (today, an "apm" invocation) to actually do the suspend.  Right
after that, I put the code I wanted to execute on resume.


		--Steve Bellovin, http://www.cs.columbia.edu/~smb