On Sep 3, 2009, at 1:02 PM, Damien Sorresso wrote:
On Sep 3, 2009, at 10:37 AM, Dean Shavit wrote:
I am aware of that. But there's differences in behavior. In Leopard, specifying any Session Type listed in the LaunchAgent using "sudo" worked to write the Disable key in the plist targeted. In Snow Leopard, this behavior does not hold true for the overrides.plist
I'd argue that the Leopard behavior was improper. Asking to modify a job in a session where it cannot exist should be a no-op.
Agreed that the Leopard behavior was improper. However, since the "proper" behavior was not documented, and still isn't, I would argue that the launchctl man page needs some concrete examples and explanation of the proper behavior - it is really thin, and apropos shows no mention of "overrides.plist" anyway. My LaunchAgent contains *two* Session Types - Aqua and LoginWindow, just like com.apple.RemoteDesktop.plist If the "correct" behavior is to limit the unload/load behavior to "active" or "existable" Session Types, you should say so in the man page. Since it worked in Leopard, I made the incorrect assumption it would carry over to Snow Leopard. If you wish, I will *volunteer* to expand the man page with some more examples for the next release of Mac OS X. Just send me the NDA, and I'm your man-scribe for the next two years....
In any case, we really hope to clean up the mess of sessions post- Snow Leopard. We also just want to get rid of the Disabled key entirely.
OK, go ahead, get rid of the key, but please leave some sort of mechanism for sysadmins or developers to disable a LaunchAgent via an override mechanism so long as they can sudo as root. I also personally feel that once the override is applied, no logout should be required to unload a currently running instance of the LaunchAgent in quesiton - the override should automatically unload the LaunchAgent for currently logged in users and terminate any processes they've spawned. As it is, we have a lot of manual cleanup to do if we want to stop one without a logout. Also, while we're on the subject of post-Snow Leopard, please consider implementing group, user, and computer-level management of LaunchAgents via MCX.
-- Damien Sorresso BSD Engineering Apple Inc.