[launchd-dev] Loading LaunchDaemons

Jeremy Reichman jaharmi at jaharmi.com
Fri Jan 18 07:45:47 PST 2008


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?

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

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

The LaunchDaemon file was installed by a simple copy -- actually, via the
Radmind system management tool. Ergo, `launchctl load` was never explicitly
run on it on any of the systems, but I seem to get different behavior --
some load it, some don't. (I'm still in the process of collecting
information on where it works and where it doesn't.)

Thanks!


-- 
Jeremy




More information about the launchd-dev mailing list