On Sep 13, 2013, at 6:47 AM, Gerriet M. Denkmann wrote:

> I have a helper tool (started via SMJobBless from the main app).
> 
> Its launchd.plist contains (no idea why, probably I copied this from some 
> sample code):
> LaunchOnlyOnce = YES
> RunAtLoad = YES
> OnDemand = NO    
> 
> The problem: it runs even when the the main app has never asked it to run.
> Obviously it gets started automatically on login (or even directly after 
> reboot?).

Yep. You asked it to. launchd launched it for you, and your app probably just 
sits waiting for something to happen vs immediately acting on args and exiting 
when done.

Delete them as Charles said. ;)



> What launchd options are needed for this?

None at all, actually. Just supply the Label and (likely) the MachServices 
entry so that you can communicate via XPC or whatnot.




> Is there some other way to find out whether it is running?

SMJobCopyDictionary(kSMDomainSystemLaunchd, …)

There will be a PID entry if it's running.





On Sep 13, 2013, at 12:08 PM, Jeremy Matthews wrote:

> I'm getting prepped for writing few of those...any good sample code out there?
> 
> I was having some issues compiling Apple sample code from a version of Xcode 
> that shall not be named...throwing bizarre errors. Figured I'd start with 
> some sane, validated goodness.

I just started doing this yesterday as well. Get the latest SMJobBless sample 
code and *read everything*. You have to understand all the codesigning nonsense 
before the sample will even run. It's actually not too difficult. I'm sorting 
through XPC right now making sure I'm doing it right, but it's all working.



--
Seth Willits



_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to