I have a launchd daemon definition


which contains:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">

At boot time, this does not work. But when logged in, I can get it to run with sudo launchctl load /Library/LaunchDaemons/homebrew.mxcl.docker-machine.plist

Any tips what I can do to find out why the launchd plist doesn't get the program started during boot/startup, but does later?

And suppose (which is a distinct possibility) that this daemon depends on another launchd daemon having been run first (and to make it complicated: that daemon only runs once to install kexts), is there a way around that problem?

  • Did it get disabled? Try sudo launchctl load -w /Library/LaunchDaemons/homebrew.mxcl.docker-machine.plist (note the -w). – Gordon Davisson Jan 10 '19 at 22:27
  • Are you sure it's not being launched, or could it just be failing? If it keeps failing, KeepAlive will use a 10-second cooldown before relaunching. A few more ideas: is sysbh your user? If so, is your home directory encrypted? That would stop it from working until you logged in. Also, if this is your user, would it not be better to implement this as a Launch Agent? (put the launchd plist in ~/Library/LaunchAgents/) – pmdj Jan 11 '19 at 12:53
  • Finally, you mention a kext dependency; you can make Launch Daemons and Agents launch when an IOKit node is matched. However, the agent binary must respond to that message. So this will only work if your kext publishes a node in the IORegistry, and if docker-machine can handle the generated IOKit matching XPC event. – pmdj Jan 11 '19 at 12:53
  • No, it did not get Disabled and I do not need the -w flag to make it work from the command line. The disk is FileVaulted, but at the point the daemons are loaded it has been decrypted already (required for boot). It is clear that the command fails during boot time, but not later when loaded by hand. It should not be a LaunchAgent as it must start before anyone logs in, it is just that I don't want that process to run with root privileges for security reasons, so I'm using another user. How do I find out if the kext publishes that node? – gctwnl Jan 11 '19 at 23:11

You must log in to answer this question.

Browse other questions tagged .