Hi I am using LaunchDaemons to execute daemon on Mac OS 10.5 I am using IOKit in my daemons But while it executing daemons it give error in IOServiceOpen API at the time of boot So which services i have to add with MachServices property key Thanks p2 -- _____________________________________________________________________ Disclaimer: This e-mail message and all attachments transmitted with it are intended solely for the use of the addressee and may contain legally privileged and confidential information. If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution, copying, or other use of this message or its attachments is strictly prohibited. If you have received this message in error, please notify the sender immediately by replying to this message and please delete it from your computer. Any views expressed in this message are those of the individual sender unless otherwise stated.Company has taken enough precautions to prevent the spread of viruses. However the company accepts no liability for any damage caused by any virus transmitted by this email. _____________________________________________________________________
At 13:48 +0530 1/4/08, Pradip Patel wrote:
I am using LaunchDaemons to execute daemon on Mac OS 10.5 I am using IOKit in my daemons
But while it executing daemons it give error in IOServiceOpen API at the time of boot
So which services i have to add with MachServices property key
I think you're a bit in the weeds here. Are you trying to connect to a service or vend a service? The MachServices property is only relevant if you're trying to vend a Mach service. You don't need to put anything special in your launchd property list file to just connect to a service. Does this stuff work if you load your daemon post boot? My best guess, given the info above, is that you're trying to connect to an I/O Kit service early in the boot process, and the service hasn't got around to being registered yet. S+E -- Quinn "The Eskimo!" <http://www.apple.com/developer/> Apple Developer Relations, Developer Technical Support, Core OS/Hardware
Re: [launchd-dev] MachServicesYes it works in post boot, can you please tell me the name of IOkit service ? is it com.apple.iokit ? p2 ----- Original Message ----- From: Quinn To: launchd-dev@lists.macosforge.org Sent: Tuesday, April 01, 2008 5:04 PM Subject: Re: [launchd-dev] MachServices At 13:48 +0530 1/4/08, Pradip Patel wrote: I am using LaunchDaemons to execute daemon on Mac OS 10.5 I am using IOKit in my daemons But while it executing daemons it give error in IOServiceOpen API at the time of boot So which services i have to add with MachServices property key I think you're a bit in the weeds here. Are you trying to connect to a service or vend a service? The MachServices property is only relevant if you're trying to vend a Mach service. You don't need to put anything special in your launchd property list file to just connect to a service. Does this stuff work if you load your daemon post boot? My best guess, given the info above, is that you're trying to connect to an I/O Kit service early in the boot process, and the service hasn't got around to being registered yet. S+E -- Quinn "The Eskimo!" <http://www.apple.com/developer/> Apple Developer Relations, Developer Technical Support, Core OS/Hardware - This message has been scanned for viruses, spam and dangerous content and is believed to be clean. ------------------------------------------------------------------------------ _______________________________________________ launchd-dev mailing list launchd-dev@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo/launchd-dev -- _____________________________________________________________________ Disclaimer: This e-mail message and all attachments transmitted with it are intended solely for the use of the addressee and may contain legally privileged and confidential information. If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution, copying, or other use of this message or its attachments is strictly prohibited. If you have received this message in error, please notify the sender immediately by replying to this message and please delete it from your computer. Any views expressed in this message are those of the individual sender unless otherwise stated.Company has taken enough precautions to prevent the spread of viruses. However the company accepts no liability for any damage caused by any virus transmitted by this email. _____________________________________________________________________
At 17:12 +0530 1/4/08, Pradip Patel wrote:
Yes it works in post boot, can you please tell me the name of IOkit service ? is it com.apple.iokit ?
There is no named I/O Kit Mach service. You seem to be mixing up two uses of the word "service", namely Mach services that are registered with the Mach bootstrap name server (which is the usage in the launchd property list file) and I/O Kit services which are registered in the I/O registry. These are very different concepts. If you're trying to find an I/O Kit service and failing to find it at early boot time, that's probably because the service hasn't been registered yet. I presume you're looking up the I/O Kit service using some simple API, like IOServiceGetMatchingService. That will work post boot, because your daemon has been launchd after I/O Kit has fully populated the registry. However, it may not work in an early boot environment because your daemon might be started before the I/O registry has been fully populated. The best solution to this problem is to dynamically handle I/O Kit services coming and going, by using I/O Kit's async service lookup APIs. Check out the IOServiceAddMatchingNotification routine. And, as an added benefit, you'll be able to handle the service coming and going dynamically. At 17:15 +0530 1/4/08, Pradip Patel wrote:
same thing work on 10.4
Yes. 10.5 is even more concurrent than 10.4 was, which means that its even more likely that your launchd daemon is starting while the kernel is still populating the I/O registry. S+E -- Quinn "The Eskimo!" <http://www.apple.com/developer/> Apple Developer Relations, Developer Technical Support, Core OS/Hardware
participants (2)
-
Pradip Patel
-
Quinn