Ask Different is a question and answer site for power users of Apple hardware and software. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "">
<plist version="1.0">

Any idea on how to fix this?

share|improve this question
This very question has been asked on Stack Overflow: link. Please avoid cross-posting. – Bavarious May 7 '11 at 23:04
sorry, was just about to delete it on SO. thaught this site would be a better place for this kind of quenstions. – Mato May 7 '11 at 23:09
up vote 5 down vote accepted

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.)

share|improve this answer
Specifically, adding "-k" (or "--keep-in-foreground") to the ProgramArguments array should do it. After doing this, you might also want to switch KeepAlive to true (so launchd will restart it if it quits for some reason). – Gordon Davisson May 8 '11 at 1:17

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.