Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8558245
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T15:46:05+00:00 2026-06-11T15:46:05+00:00

Is there a way to know the return code or process ID of the

  • 0

Is there a way to know the return code or process ID of the process which gets executed when the privileged helper tool is installed as a launchdaemon and launched via SMJobSubmit().

I have an application which to execute some tasks in privileged manner uses the SMJobSubmit API as mentioned here.

Now in order to know whether the tasks succeeded or not, I will have to do one of the following.

  1. The best option is to get the return code of the executable that ran.
  2. Another option would be if I could create a pipe between my application and the launchd.
  3. If the above two are not possible, I will have to resort to some hack like writing a file in /tmp location and reading it from my app.

I guess SMJobSubmit internally submits the executable with a launchdaemon dictionary to the launchd which is then responsible for its execution. So is there a way I could query launchd to find out the return code for the executable run with the label “mylabel”.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T15:46:06+00:00Added an answer on June 11, 2026 at 3:46 pm

    There is no way to do this directly.

    SMJobSubmit is a simple wrapper around a complicated task. It also returns synchronously despite launching a task asynchronously. So, while it can give you an error if it fails to submit the job, if it successfully submits a job that fails to run, there is no way to find that out.

    So, you will have to explicitly write some code to communicate from your helper to your app, to report that it’s up and running.

    If you’ve already built some communication mechanism (signals, files, Unix or TCP sockets, JSON-RPC over HTTP, whatever), just use that.

    If you’re designing something from scratch, XPC may be the best answer. You can’t use XPC to launch your helper (since it’s privileged), but you can manually create a connection by registering a Mach service and calling xpc_connection_create_mach_service.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to know if there is any way to return an char
Is there any way to know which version of MS-Office I have on my
Is there a way to know when code is being called from running a
Is there any way to know in Servlet is JS is enable or not
Is there a way to know where is set a given PHP config property?
Is there a way to know if Visual C++ 2008 SP1 Redistributable Package is
is there a way to know when an object will be disposed by GC?
Is there any way to know for events when move a window with window.open?.
Is there a way to know when a view is viewable to user? For
Is there a way to know that the user is closing the navigator, and/or

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.