• 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
Notification for launch of root daemon process?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Notification for launch of root daemon process?


  • Subject: Notification for launch of root daemon process?
  • From: Dave DeLong <email@hidden>
  • Date: Mon, 17 Aug 2009 10:42:10 -0600

Hi everyone,

Is there some notification that's posted by the OS when a root daemon process is launched? Here's what I've tried:

1. Carbon Events - I tried creating a CarbonEventHandler to listen for kEventAppLaunched, but I did not observe any events come through after running backupd. It would appear (and the documentation seems to confirm this) that these notifications are posted only for processes that interact with the WindowServer.

2. Distributed Notifications - I found that the root daemon I'm trying to observe posts distributed notifications as it launches and exits, but I've also found that these notifications are not reliable and are sometimes dropped.

3. Polling attempt 1 - I created a timer that executes "ps aux" as an NSTask and searches the results for the name of the daemon. This works, but involves creating another process and searching through a string every time I need to find if the daemon is running (which is every couple seconds).

4. Polling attempt 2 - Again, I created a timer, but this time I used the GetBSDProcessList function (defined here: http://developer.apple.com/qa/qa2001/qa1123.html ). This also works and is *significantly* faster than creating an NSTask to run "ps", but it still requires me to poll. In addition, I still have to search through the entire process structure looking for the correct process name. However, since I don't have anything better right now, this is what I'm currently using.

Is there a better way I could be doing this?

Thanks,

Dave
_______________________________________________

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: Notification for launch of root daemon process?
      • From: Todd Heberlein <email@hidden>
  • Prev by Date: Re: [SOLVED, with reservations] Re: Turn off menu highlight in outline view?
  • Next by Date: Audio CD Subchannel Info
  • Previous by thread: Re: looking for System APIs for load monitoring
  • Next by thread: Re: Notification for launch of root daemon process?
  • Index(es):
    • Date
    • Thread