How to find out what launch agent or daemon is starting a process After installing Autodesk Smoke, I have two httpd processes running all the time, and I'd like to stop them.  When I use sudo killall httpd, they stop and are restarted right away.  Activity Monitor shows that the parent process is launchd, but how do I determine which agent or daemon is starting it so I can disable it?

launchctl list | grep httpd shows these results:

302 -   0x7f94ea700dd0.anonymous.httpd  
92  -   org.apache.httpd


I look in /System/Library/LaunchDaemons/org.apache.httpd.plist and it shows the following. You can see it's set to disabled.  The other launchd item with a weird name doesn't show up in a filesystem search, so I have no idea what it is.

&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"&gt;
&lt;plist version="1.0"&gt;
&lt;dict&gt;
    &lt;key&gt;Disabled&lt;/key&gt;
    &lt;true/&gt;
    &lt;key&gt;Label&lt;/key&gt;
    &lt;string&gt;org.apache.httpd&lt;/string&gt;
    &lt;key&gt;EnvironmentVariables&lt;/key&gt;
    &lt;dict&gt;
        &lt;key&gt;XPC_SERVICES_UNAVAILABLE&lt;/key&gt;
        &lt;string&gt;1&lt;/string&gt;
    &lt;/dict&gt;
    &lt;key&gt;ProgramArguments&lt;/key&gt;
    &lt;array&gt;
        &lt;string&gt;/usr/sbin/httpd&lt;/string&gt;
        &lt;string&gt;-D&lt;/string&gt;
        &lt;string&gt;FOREGROUND&lt;/string&gt;
    &lt;/array&gt;
    &lt;key&gt;OnDemand&lt;/key&gt;
    &lt;false/&gt;
&lt;/dict&gt;
&lt;/plist&gt;
You can grep the output of launchctl list for the pid:

$ pgrep -fl foo
40679 bash /tmp/foo
$ launchctl list|grep 40679
40679   -   com.example.foo


Then for example look for a file named com.example.foo.plist in ~/Library/LaunchAgents/, /Library/LaunchAgents/, or /Library/LaunchDaemons/.

Edit: the Disabled key can be overridden in /var/db/launchd.db/com.apple.launchd/overrides.plist, which is modified when launchctl load -w is run as root, or in /var/db/launchd.db/com.apple.launchd.peruser.$UID/overrides.plist, which is modified when launchctl load -w is run as the user.

If the Apache plist that comes with OS X was enabled, you can disable it by running sudo launchctl unload -w /System/Library/LaunchDaemons/org.apache.httpd.plist.