> apmd runs the script, and does nothing until the script is > finished. > > The script runs apm. > > apm talks to apmd. > > apmd is not listening, it is busy waiting for the script to > finish. > > > Once you understand the mechanism you'll realize it will never work.
Thanks for the clarification. May I ask you devs to put a note on it into http://man.openbsd.org/apmd.8 as there is currently no description of `apmd` waiting for `/etc/apm/*` executables to finish without processing new calls in the meantime. May I ask you to also add a warning that self-lock will occur if the user intends to call `apm` from `/etc/apm/*` And may I ask you to also add hints on workarounds like backgrounding (`apm &`) or running yet another script, in background again, from `/etc/apm/*` scripts. For me personally it was quite time-consuming and frustrating experience without such knowledge. From my user perspective, such self-lock peculiarity looks like a mechanism flaw and I hope it will be resolved in future versions. I myself can't help with code enhancement, sorry. `apmd` apparently doesn't do completely nothing while waiting for the script to finish because auto-adjusting of `sysctl hw.cpuspeed` & `sysctl hw.setperf` does happen dynamically depending upon load. I apologize for me mistaking `powerup` for switching machine on instead of A/C plugged and `powerdown` for switching off instead of A/C unplugged so my snippets read weird. I had to use `@reboot` in `crontab`. Answer received, thanks to participants, best wishes
