Re: Helper tool
Re: Helper tool
- Subject: Re: Helper tool
- From: "Gerriet M. Denkmann" <email@hidden>
- Date: Sun, 15 Sep 2013 15:02:14 +0700
On 13 Sep 2013, at 22:09, Charles Srstka <email@hidden> wrote:
> On Sep 13, 2013, at 8:47 AM, "Gerriet M. Denkmann" <email@hidden> 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?).
>
> The problem, obviously, that you don't want those options. Just get rid of all of them and the default values should be fine for what you want to do. My launchd.plist just looks like this:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
> <plist version="1.0">
> <dict>
> <key>label</key>
> <string>com.foo.MyGreatApp</string>
> <key>MachServices</key>
> <dict>
> <key>com.foo.MyGreatApp.helper</key>
> <true/>
> </dict>
> <key>ProgramArguments</key>
> <array>
> <string>/Library/PrivilegedHelperTools/com.foo.MyGreatApp.helper</string>
> </array>
> </dict>
> </plist>
>
> Charles
Following your advice I got rid of all of them and all was well.
But then I made some changes in the main app as well as in the helper tool and nothing worked anymore.
Turns out that still the old helper tool (which is no longer compatible to the new main app) was running.
And nothing did change this:
Quitting the helper tool via Activity Monitor,
installing a newer version via SMJobBless,
Deleting: /Library/PrivilegedHelperTools/name.of.Tool,
Deleting: /Library/LaunchDaemons/name.of.Tool.plist ,
and any random combination thereof.
The only way to get the new version was to log out, log in.
Could it be that LaunchOnlyOnce = NO (default) means:
Mac OS X takes the current version, hides it somewhere and (short of logout) stubbornly ignores all newer versions?
The man pages on launchd.plist really are (as Kevin Meaney rightly mentioned) not very clear about this.
Kind regards
Gerriet.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden