Super User is a question and answer site for computer enthusiasts and power users. 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

First off: Im absolutely new to Mac, so the problem might be really really basic.

I have been trying to set up a Launchd Daemon to run at startup to run a Service via Mono.Frameworks. I used Lingon to create the .plist file

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

The command to start the service does work fine when run manually

It does however not start automatically on startup. Any help? Im really stuck since this is the first time Im using a Mac.


share|improve this question

Launchd expects the programs it launches not to daemonize themselves; if they do, launchd detects it as the program exiting, and cleans up all subprocesses (i.e. kills the now-daemonized program). Depending on the daemon's start and/or keepalive conditions, it might then relaunch it, and do the whole thing over and over again. In this case, I think all you need to do is add <string>--no-daemon</string> to the ProgramArguments array.

A few more (less critical) changes I'd make: first, lose the sudo -- it's not needed (launchd runs daemons as root unless told to do otherwise), and if it were needed it wouldn't work (it needs to prompt for a password, and there's nobody available in daemon context). Second, the WorkingDirectory key and -d argument seem to do exactly the same thing; there's no point in using both. Finally, you might want to add <key>KeepAlive</key><true/>, so that if the service does crash it'll get relaunched automatically.

share|improve this answer
You can also use <key>AbandonProcessGroup</key><true/> to instruct launchd not to kill the child processes if you want to allow programs to daemonize themselves. – Courtney Faulkner Apr 19 '11 at 19:08

Launchd is freaky about permissions. If it's not owned by root:wheel, with permissions set to 600, it will most likely not do anything with that plist at startup, regardless of how you load it, or what it says inside.. You may notice a log entry about "Dubious Permissions" in such a case. If this is the problem...

sudo chown root:wheel /Library/LaunchDaemons/
sudo chmod 600 /Library/LaunchDaemons/
sudo launchctl unload -w /Library/LaunchDaemons/
sudo launchctl load -w /Library/LaunchDaemons/

Another little publicized fact about LaunchDameons is the shady smorgasbord of launchd preferences in the sanctuary of


if you've got an entry in any of those overrides.plist's with


That sucker ain't never gonna launch.

share|improve this answer
upvote for you sir. saved an un-bootable install! – OrangeBox Jan 18 '12 at 23:51

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .