Solving launchctl load “nothing found to load” error

Today I was playing with OSX launchctl command, in order to autoload a program using a simple and human-readable XML file (.plist).
Initially my command (sudo launchctl load /path/to/myplist.plist) was giving back an error message “nothing found to load” and I thought it was a bad configuration in the plist, so I checked every path and every settings I specified in it and I realized it was ok… so using the manual (man launchctl) I looked for helpful flags and/or additional help, I then modified the command adding the -F and -w flags and I was able to run my program succesfully. It also started up automatically after a reboot as I wished.
The final command is:

sudo launchctl load -w -F /path/to/myplist.plist

Flags descriptions are the following:

-w Overrides the Disabled key and sets it to false. In previous versions, this option would modify the configuration file. Now the state of the Disabled key is stored elsewhere on-disk.

-F Force the loading of the plist. Ignore the Disabled key.

8 thoughts on “Solving launchctl load “nothing found to load” error

  1. diglin

    If you have to force the load or unload of a plist file, it means that you have a config which is overrides the plist. This overriding is created when you use the “-w” otherwise otherwise no override will be added to the overrides file.
    To prevent this case, edit the file below, search the job label that you want to remove the override, delete the necessary lines:

    > pico /var/db/launchd.db/com.apple.launchd/overrides.plist

    For example, delete this line
    com.mydomain.myjob

    Disabled

    then you could use: launchctl load or unload /Library/LaunchDaemons/com.mydomain.myjob.plist without the need of “-w” or “-F”

  2. thomas

    You wrote “sudo launchtl” but it should be “sudo launchctl”. Somebody could get problems when he copies your paragraph.

  3. craiger316

    Thanks a bunch! I was having all sorts of problems loading dnsmasq after cleaning my machine and going to Mountain Lion. the dnsmasq plist just refused to load with the same “nothing to load” error. Adding the extra flags to launchctl did the trick.

  4. Vipin JOhney

    I have a problem loading launchagent in is all users logged in using fast user switch. The loaded apps of other users appears in the currently active user window. Can somebody help.

Leave a Reply