I run a -current apmd on a MacBook3,1.
It suspends and resumes just fine.
There seems to be a slightly unclear detail
in the apmd(8) manpage however:
/etc/apm/suspend
/etc/apm/standby
/etc/apm/resume
/etc/apm/powerup
/etc/apm/powerdown These files contain the host's customized actions.
Each file must be an executable binary or shell
script. A single program or script can be used to
control all transitions by examining its argument
list, which is set to one of suspend, standby,
resume, powerup, or powerdown.
The wording "argument list, which is set to ..." suggests
that apmd calls the scripts with an argument ($1) of "suspend",
or an argument of "resume" etc; it does not - when apmd suspends,
it simply runs /etc/apm/suspend, but does not give it any "argument
list". (The script can still examine the name by which it was called,
of course.)
This is examplified by the following:
# ls -li /etc/apm
total 20
8089 -rwxr-xr-x 5 root wheel 54 Oct 27 08:43 powerdown
8089 -rwxr-xr-x 5 root wheel 54 Oct 27 08:43 powerup
8089 -rwxr-xr-x 5 root wheel 54 Oct 27 08:43 resume
8089 -rwxr-xr-x 5 root wheel 54 Oct 27 08:43 standby
8089 -rwxr-xr-x 5 root wheel 54 Oct 27 08:43 suspend
# cat /etc/apm/suspend
#!/bin/sh
echo `date` $0 called with $@ >> /tmp/log
[suspend now]
[resume now]
# cat /tmp/log
Wed Oct 27 15:04:17 CEST 2010 /etc/apm/suspend called with
Wed Oct 27 15:04:28 CEST 2010 /etc/apm/resume called with
I believe the diff below makes the wording more clear.
Jan
--- apmd.8.orig Wed Oct 27 15:09:14 2010
+++ apmd.8 Wed Oct 27 15:10:21 2010
@@ -182,8 +182,8 @@
These files contain the host's customized actions.
Each file must be an executable binary or shell script.
A single program or script can be used to control all transitions
-by examining its argument list,
-which is set to one of
+by examining the name by which it was called,
+which is one of
suspend,
standby,
resume,