Is there any way with ld/lctrl to execute pre/post commands similar to systemd's ExecStartPre/ ExecStopPost?

  • You might want to clarify what you're trying to accomplish, for people who have no idea what systemd's ExecStartPre/ ExecStopPost do.
    – TJ Luoma
    Aug 5, 2020 at 16:17
  • @TJLuoma oh sure, basically run some commands before or after the main daemon, usually for init or tear-down...
    – Woodstock
    Aug 5, 2020 at 17:59

1 Answer 1


No, there is no such functionality in launchd (as far as I am aware, and I consider myself pretty familiar with launchd).

The best site that I know of for launchd info is https://www.launchd.info which is maintained by the developer of LaunchControl which is my favorite, and I would argue also the best, tool for managing launchd on the Mac, although I do have to admit that Lingon is also excellent.

If I wanted to do something like that with launchd I would end up making a shell script of some kind to run the command before, then run the daemon, then run the commands after. Not nearly as satisfying, of course.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .