On Wed, Oct 27, 2010 at 03:12:51PM +0200, Jan Stary wrote:
> 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
> 
> 

ok, this is giving me a sore head and i'm fed up of looking at it. i
freely admit i do not understand this part of the manpage. so...

> I believe the diff below makes the wording more clear.
> 

if some developer wants to agree that jan is correct we can look at a
fix. jan, i think your diff is incorrect - isn;t it just repeating what
we've already said? if what you say is true, isn;t the best fix just to
remove the text "A single program...powerdown."?

of course the disclaimer that my head is sore applies...
jmc

>       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,

Reply via email to