Previous 1 2 Next 15 Replies Latest reply: Nov 18, 2012 8:55 AM by bewst Go to original post
  • bewst Level 1 Level 1 (0 points)

    twtwtw wrote:

     

    The problem isn't so much that the documentation is vague or incomplete, but that the people who wrote the docs are Apple software engineers who have a skewed understanding of what constitutes common knowledge and what needs to be explained.

    No, that's the cause of the problem.  The result is that the docs are vague and incomplete.

    For instance, at the very bottom of man launchd.plist you'll find this:

     

         ~/Library/LaunchAgents         Per-user agents provided by the user.

         /Library/LaunchAgents          Per-user agents provided by the adminis-

                                        trator.

         /Library/LaunchDaemons         System-wide daemons provided by the admin-

                                        istrator.

         /System/Library/LaunchAgents   Per-user agents provided by Mac OS X.

         /System/Library/LaunchDaemons  System-wide daemons provided by Mac OS X.

    Which tells us that LaunchAgents run as users and LaunchDaemons run as root.

    Disagreed.  Neither who the agents are "provided by" nor whether they are "per-user" or "System-wide" definitively implies anything at all about the UID that actually runs the jobs.

     

     

      Whoever wrote the man page apparently assumed that this was so obvious it only needed a footnote - go figure - but it is there.  Have you seen the technote on agents and daemons and the daemons and services programming guide?  A bit more low-level than you need, but possibly helpful for background info.

     

    Actually, no, I hadn't seen that first one.  At this point I'd appreciate Apple erring on the side of "more low-level than I need" 

     

    It seems as though launchd had some internal tweaking done in the 10.6 to 10.7 transition, maybe in the 10.8 as well.  I'll have to look at your benchtest more closely.  But I hope you see my point.

    Mostly.  It's easy to say, with 20/20 hindsight, that I was misusing the facilities of launchd.  I still maintain that (modulo that technote that I haven't read yet) Apple makes it pretty darned hard to figure out what misuse is.

Previous 1 2 Next