Subject: Re: Powerd(8) question
To: Steven M. Bellovin <smb@cs.columbia.edu>
From: Jared D. McNeill <jmcneill@invisible.ca>
List: current-users
Date: 08/20/2007 19:08:19
On Mon, 20 Aug 2007, Steven M. Bellovin wrote:
> 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.

Careful, 'apm -z' is asynchronous -- to be safe you really want to 
manipulate the machdep.sleep_state sysctl directly -- ``/sbin/sysctl 
-w machdep.sleep_state=3'' will not return until the system has resumed.

Cheers,
Jared