Skip navigation

launchd disobeying plist

2325 Views 34 Replies Latest reply: May 7, 2012 6:36 PM by Jonathan Pool RSS
  • Mike Mesford Level 1 Level 1 (25 points)
    Currently Being Moderated
    May 7, 2012 2:48 PM (in response to Jonathan Pool)

    As I understand it, you should place your plist file in LaunchDaemons rather than LaunchAgents if you only want it to run when certain parameters are met.  Once the plist file is in that directory, run 'launchd load /System/Library/LaunchAgent/<your file>.plist'

  • Mike Mesford Level 1 Level 1 (25 points)
    Currently Being Moderated
    May 7, 2012 3:16 PM (in response to Jonathan Pool)

    Well, I can't find where I read that so I must've made it up.  My re-reading of the documentation agrees with your interpretation.  So I'll go back to trying to understand the "exec format error" that led me to this discussion in the first place. 

  • twtwtw Level 5 Level 5 (4,580 points)
    Currently Being Moderated
    May 7, 2012 6:19 PM (in response to Jonathan Pool)

    ok, a short bit of testing and I understand why the utility launches immediately.  QueueDirectories checks at load whether the directories in question contain anything and triggers the utility if they do.  even an invisible .DS_Store file is enough, and it will keep the utility alive until the folder is empty again.  that explains the start-at launch problem. 

     

    I'm not seeing the cause of the exec error yet.  a quick google search tells that this is a non-specific error (e.g., what the interpreter says when it's grumpy about something it hasn't been programmed to expect).  a common cause seems to be spurious invisible/whitespace characters at the beginning of the script file.

     

    WatchPaths jobs do not recurse.  as I suggested, better to do periodic syncs.

1 2 3 Previous Next

Actions

More Like This

  • Retrieving data ...

Bookmarked By (0)

Legend

  • This solved my question - 10 points
  • This helped me - 5 points
This site contains user submitted content, comments and opinions and is for informational purposes only. Apple disclaims any and all liability for the acts, omissions and conduct of any third parties in connection with or related to your use of the site. All postings and use of the content on this site are subject to the Apple Support Communities Terms of Use.