[launchd-dev] SMJobBless not copying entire __launchd_plist

Richard Brown rabrown at quantumcheese.com
Fri Jul 9 06:33:33 PDT 2010


The documentation for SMJobBless states that "[t]he helper tool must
have an embedded launchd plist. The only required key in this plist is
the Label key."  This implies to us that other keys in the embedded
launchd plist (except Program and ProgramArguments) will be respected.

However, we find that the executable is copied into place, but only
the Label of our embedded launchd plist (and the ProgramArguments
generated by the API call) is written out to the
/Library/LaunchDaemons/reverse-dns-label.helper.plist.

We are further unable to get the SMJobBless API to upgrade the
installed helper tool based on "Bundle version" version number in the
__info_plist; we instead receive "(kSMErrorDomainFramework error -308
- Unknown error code: -308)" in the CFErrorRef.  But if we manually
remove the launchd job and delete the helper tool & plist files,
SMJobBless succeeds, with the new launchd plist containing the same
information as the previous, namely the Label and ProgramArguments,
but nothing else from the embedded __launchd_plist section.

Can anyone help explain these issues?  Should we try a workaround of
SMJobCopyDictionary / mutate dictionary / SMJobSubmit to get our other
keys/values into the launchd plist?

Thanks,
RB


More information about the launchd-dev mailing list