• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Why doesn't SMJobBless sample work?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Why doesn't SMJobBless sample work?


  • Subject: Why doesn't SMJobBless sample work?
  • From: Motti Shneor <email@hidden>
  • Date: Mon, 11 Jan 2016 10:44:56 +0200

Hi. Excuse this novice question (I see previous questions relating to SMJobBless that start off where I need to finish…)

I need to develop an OS-X daemon (in c++) that must run privileged. I intend to deploy it embedded in a System-Preferences panel, that will launch it using the SMJobBless() API.

Naturally, I read Apple “Deamons and Services programming guide” (which left me with more questions than I initially had) and downloaded the simple but enlightening “SMJobBless” sample project.

Alas - the sample doesn’t function. It builds, runs and the application asks me for admin credentials, then it always spits the same error:

>>> 2016-01-11 10:35:52.580 SMJobBlessApp[83383:3929331] Something went wrong! CFErrorDomainLaunchd / 4

I started thinking there should be some specific code-signing involved, to allow one application to launch privileged daemon, but nothing is documented about this both in the sample itself, nor in the SMJobBless() API referene.

I started playing with signing both the App and the daemon with my own developer ID (the sample project itself has no code-signing defined for the application, and some arbitrary code-signing set for the daemon itself).

(I also found and examined 3 or 4 other related code-samples, that seem to be based on this, some with XPC communications between the app and its daemon, some without) but all give that exact same error message above, when the app attempts to SMJobBless() its daemon.

Now — any heads-up or hint will be greatly appreciated.


Motti Shneor.
_______________________________________________

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


  • Follow-Ups:
    • Re: Why doesn't SMJobBless sample work?
      • From: Motti Shneor <email@hidden>
    • Re: Why doesn't SMJobBless sample work?
      • From: John Brownie <email@hidden>
  • Prev by Date: Re: Panes vs. Separate Windows
  • Next by Date: Re: Why doesn't SMJobBless sample work?
  • Previous by thread: Re: Panes vs. Separate Windows
  • Next by thread: Re: Why doesn't SMJobBless sample work?
  • Index(es):
    • Date
    • Thread