[launchd-dev] Loading LaunchDaemons

Dave Zarzycki zarzycki at apple.com
Fri Jan 18 08:52:54 PST 2008

On Jan 18, 2008, at 7:45 AM, Jeremy Reichman wrote:

> Do new jobs that are copied to a directory like /Library/ 
> LaunchDaemons get
> loaded automatically by the system at startup, so that they run when  
> they
> would normally be scheduled? Or must we specifically load them with
> launchctl?

They get loaded at boot (or in the case of agents: at login). One  
should only need to run launchctl during prototyping/development of  
the job.

> I've looked back through the launchd and launchctl man pages and I  
> don't see
> there whether a new job must be explicitly loaded, or if simply  
> having it in
> the right directory at startup is enough to load/activate it.

I suppose that the documentation on that fact could be better. Feel  
free to file a bug.

> I have a custom LaunchDaemon which works fine when loaded -- I'm very
> enthusiastic about how well it works on Leopard vs. Tiger, because  
> the job
> is scheduled to run when systems are typically asleep. The new  
> behavior of
> running the job at wakeup is great.

Thanks! :-)

> Anyway, on some systems (all of which are Intel-based Macs running  
> 10.5.1
> with all current updates except for iTunes 7.6 and QuickTime 7.4),  
> the job
> I've installed does not and has not been running, even though the  
> computers
> in question have been rebooted multiple times. It appears the job  
> itself is
> not loading; when I grep for it in the long results of `launchctl  
> list`, I
> don't see it. (Loading it manually does show that it is loaded, of  
> course.)

Are you running "launchctl list" or "sudo launchctl list"?

Also, is launchd complaining about anything in the logs?

Good luck,


More information about the launchd-dev mailing list