prevent launchctl from starting a anonymous process I have installed dnsmasq and now I want to be able to start it with launchctl. The problem is that every time I start the app launchctl starts an anonyous process instead of using the specified label.

10247   -   0x100107c30.anonymous.dnsmasq
-       0   com.example.dnsmasq


But I want it to be

10247    0  com.example.dnsmasq


The problem with the anonymous process is that I can't stop it with launchctl. When I run

launchctl stop com.example.dnsmasq


the anonymous process still stays alive.

Here is my property file:

&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;!DOCTYPE plist PUBLIC "-//Apple Computer//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;Label&lt;/key&gt;
    &lt;string&gt;com.example.dnsmasq&lt;/string&gt;    
    &lt;key&gt;ProgramArguments&lt;/key&gt;
    &lt;array&gt;
      &lt;string&gt;/usr/local/sbin/dnsmasq&lt;/string&gt;
        &lt;string&gt;-p&lt;/string&gt;
        &lt;string&gt;2155&lt;/string&gt;
        &lt;string&gt;-R&lt;/string&gt;
        &lt;string&gt;-A&lt;/string&gt;
        &lt;string&gt;/.dev/127.0.0.1&lt;/string&gt;
        &lt;string&gt;-x&lt;/string&gt;
        &lt;string&gt;/usr/local/var/run/dnsmasq.pid&lt;/string&gt;
    &lt;/array&gt;
  &lt;key&gt;RunAtLoad&lt;/key&gt;
  &lt;false/&gt;
  &lt;key&gt;KeepAlive&lt;/key&gt;
  &lt;false/&gt;
&lt;/dict&gt;
&lt;/plist&gt;


Any idea on how to fix this?
That isn't actually launchctl creating a new process; it's most likely dnsmasq  itself.  If it fork()s into the background, launchd can't tell; then when it talks to launchd, launchd creates an anonymous entry for it.  Make sure dnsmasq doesn't background itself.

(The - listed for the regular launchctl list output indicates that the original dnsmasq process exited.)