Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: launchctl load hangs when called via AppleScript



On 28 mai 08, at 16:14, Dave Gradwell wrote:

I need to make a "launchctl load ~/Library/LaunchAgents/myJob.plist" call within an Applescript Studio application, where it appears to hang indefinitely.

The same command completes after a ~30 second hang in Script Editor. The command *appears* to execute promptly and successfully within the Terminal, although it is followed ~30 seconds later by the near-infamous "Workaround Bonjour: Unknown error: 0" which is a tad worrying.

Not really, under Tiger... ;-)

My remedial attempts have been to:
- detach from the call and monitor it's success retrospectively (failed)
- create a launchd 'helper': a launchAgent that's loaded at startup which uses a WatchPaths hook to monitor a folder. I hoped that newly created agents, when dropped in this folder, would 'hot load' without having to make the launchctl load call at all... however this failed: Console reports "launchd[4968]: Backaroo Job Watcher: execvp("/bin/launchctl load -F /Users/cpu058/Desktop/ Backaroo", ...): No such file or directory" - which is simply not true. (I guess a launchAgent doesn't like containing a launchctl command?)


Can anyone suggest either a solution to overcome this problem directly, or suggest an alternative means of scheduling (not Cron).

Without your myJob.plist and the code (script?) it is calling, it is rather difficult to tell...
As well as the way and the reasons why you are calling launchtl from your ASS application.
Could you provide us with somewhat more info?


TIA,
Axel
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macos-x-server mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/macos-x-server/email@hidden

This email sent to email@hidden
References: 
 >launchctl load hangs when called via AppleScript (From: Dave Gradwell <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.