Launchctl config file location

launchdnetbootplist

I'm trying to configure a NetBoot image so that a script will automatically launch on the target machine after it boots from the image

I've been using this article as a reference:

https://medium.com/@fahimhossain_16989/adding-startup-scripts-to-launch-daemon-on-mac-os-x-sierra-10-12-6-7e0318c74de1

my question is: when the following command is run…

# -w flag permanently adds the plist to the Launch Daemon
sudo launchctl load -w /Library/LaunchDaemons/com.startup.plist

…where is the resulting permanent configuration entry stored on the hard drive?

To clarify: I'm not asking for the location of the .plist file, I'm asking how/where does the system remember the .plist files that you've configured to run on startup using the 'sudo launchctl load' command?

Best Answer

You shouldn't need to explicitly load your daemon in this situation; plists in /Library/LaunchDaemons/ are auto-loaded at system startup (provided their format, permissions etc are correct). You only need launchctl load if you want to load a daemon after startup, or if it's been explicitly disabled and you want to override that.

– Gordon Davisson