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
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, davez
On 1/18/2008 11:52:54 AM, "Dave Zarzycki" <zarzycki@apple.com> wrote:
Are you running "launchctl list" or "sudo launchctl list"?
Also, is launchd complaining about anything in the logs?
I ran `launchctl list` in an admin account, but without sudo, on the first computer I've noticed this on. I'm investigating further on others. Without sudoing, running `load` and then `list` did show different results. I haven't checked the logs thoroughly yet, as I didn't have a lot of face time with the computer (had someone waiting to use it for their work) but I'll revisit that to see if I notice anything out of the ordinary. -- Jeremy
participants (3)
-
Dave Zarzycki
-
Jeremy Reichman
-
Nathan Duran