From pradip.patel at einfochips.com Tue Apr 1 01:18:09 2008 From: pradip.patel at einfochips.com (Pradip Patel) Date: Tue Apr 1 01:17:01 2008 Subject: [launchd-dev] MachServices Message-ID: <005801c893d0$eddddd00$cb01650a@PradipPatel> 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. _____________________________________________________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.macosforge.org/pipermail/launchd-dev/attachments/20080401/59e1219c/attachment.html From eskimo1 at apple.com Tue Apr 1 04:23:39 2008 From: eskimo1 at apple.com (Quinn) Date: Tue Apr 1 04:34:51 2008 Subject: [launchd-dev] How to on demand launch for configurable port number? In-Reply-To: <1451A34B-4D3A-48D9-84F3-C3F9657CD40A@mac.com> References: <1451A34B-4D3A-48D9-84F3-C3F9657CD40A@mac.com> Message-ID: At 22:15 +0100 29/3/08, Mike Fischer wrote: >Currently I'd immagine that I need to 'launchctl stop' the service, >modify the associated launchd.plist to reflect the currently >configured port and then 'launchctl start' the service. You would probably have to "unload" and "load", rather than "stop" and "start". Stop/start just affects the running process, so launchd will not reconsult the relevant plist file. >Unless of course there is a better way that doesn't involve changing >the launchd.plist? I can't think of one. >Not sure if this is relevant but the daemon does not use Bonjour at >the moment to advertise its service. That could be added though (and >might be a good idea for other reasons). If you used Bonjour, you could just bind to a ephemeral port ("SockServiceName" == "0") and find the service, which includes the port, using Bonjour. No need for fixed ports at all. S+E -- Quinn "The Eskimo!" Apple Developer Relations, Developer Technical Support, Core OS/Hardware From eskimo1 at apple.com Tue Apr 1 04:32:01 2008 From: eskimo1 at apple.com (Quinn) Date: Tue Apr 1 04:35:00 2008 Subject: [launchd-dev] OnDemand USB Software In-Reply-To: <37787CBB-7740-46D0-AAF8-4B2D05BC53F5@mac.com> References: <37787CBB-7740-46D0-AAF8-4B2D05BC53F5@mac.com> Message-ID: At 22:02 +0100 29/3/08, Mike Fischer wrote: >BTW: The launchd.plist(5) man page contains references to a >launch(3) man page (10.5.2, Xcode 3.0 as well as 10.4.11, Xcode >2.4.1). Unfortunatly the launch(3) man page does not seem to exist. >Filed as . I saw /usr/include/launch.h and the >SampleD sample code but these don't really explain what is going on >and how to properly check-in with launchd. Any hints on where to get >more information? Thanks for all those bug reports. We appreciate 'em. IMHO the best example of how to use launchd with a UNIX domain socket is: >If I understand this correctly I would not be using the socket for >actual communication, just for triggering the launch of the >"server", i.e. the real (on demand) daemon? That's the idea, yes. >Would I need to add the SockFamily or SockProtocol keys and if so >what would be the correct values for a UNIX domain socket? >Anything else I'd need to add? o SockFamily == Unix o SockPathMode is typically 438 (0666, rw-rw-rw-) -- This may not strictly be necessary in your case because the code that's connecting is privileged. o SockNodeName == ??? -- It's generally best to put this in a privileged location (/var/run/) rather than in /tmp. >In the real daemon I'd do a socket(2), bind(2), accept(2) (the >listen(2) is already done by launchd I gather)? Or do I need this at >all? In a launchd daemon you don't need to do the socket, or the bind, or the listen. You just get a file descriptor for the socket from launchd (using LAUNCH_KEY_CHECKIN) and accept connections from that. S+E -- Quinn "The Eskimo!" Apple Developer Relations, Developer Technical Support, Core OS/Hardware From eskimo1 at apple.com Tue Apr 1 04:34:13 2008 From: eskimo1 at apple.com (Quinn) Date: Tue Apr 1 04:35:04 2008 Subject: [launchd-dev] MachServices In-Reply-To: <005801c893d0$eddddd00$cb01650a@PradipPatel> References: <005801c893d0$eddddd00$cb01650a@PradipPatel> Message-ID: 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!" Apple Developer Relations, Developer Technical Support, Core OS/Hardware -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.macosforge.org/pipermail/launchd-dev/attachments/20080401/6c52df62/attachment.html From pradip.patel at einfochips.com Tue Apr 1 04:42:46 2008 From: pradip.patel at einfochips.com (Pradip Patel) Date: Tue Apr 1 04:41:37 2008 Subject: [launchd-dev] MachServices References: <005801c893d0$eddddd00$cb01650a@PradipPatel> Message-ID: <008901c893ed$832f3360$cb01650a@PradipPatel> 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!" 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. _____________________________________________________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.macosforge.org/pipermail/launchd-dev/attachments/20080401/973f4178/attachment.html From pradip.patel at einfochips.com Tue Apr 1 04:45:19 2008 From: pradip.patel at einfochips.com (Pradip Patel) Date: Tue Apr 1 04:44:20 2008 Subject: Fw: [launchd-dev] MachServices Message-ID: <00a401c893ed$de3d4a30$cb01650a@PradipPatel> Re: [launchd-dev] MachServicessame thing work on 10.4 ----- Original Message ----- From: Pradip Patel To: launchd-dev@lists.macosforge.org ; Quinn Sent: Tuesday, April 01, 2008 5:12 PM Subject: Re: [launchd-dev] MachServices Yes 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!" 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. _____________________________________________________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.macosforge.org/pipermail/launchd-dev/attachments/20080401/e904cade/attachment.html From eskimo1 at apple.com Tue Apr 1 04:54:42 2008 From: eskimo1 at apple.com (Quinn) Date: Tue Apr 1 04:55:24 2008 Subject: [launchd-dev] MachServices In-Reply-To: <008901c893ed$832f3360$cb01650a@PradipPatel> References: <005801c893d0$eddddd00$cb01650a@PradipPatel> <008901c893ed$832f3360$cb01650a@PradipPatel> Message-ID: 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!" Apple Developer Relations, Developer Technical Support, Core OS/Hardware From pradip.patel at einfochips.com Tue Apr 1 06:59:23 2008 From: pradip.patel at einfochips.com (Pradip Patel) Date: Tue Apr 1 06:58:13 2008 Subject: [launchd-dev] StartupItems Message-ID: <00da01c89400$98feded0$cb01650a@PradipPatel> Hi Is there any difference in /Library/StartupItems in MacOS 10.4 vs 10.5 ? 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. _____________________________________________________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.macosforge.org/pipermail/launchd-dev/attachments/20080401/0666571f/attachment.html From mike_fischer at mac.com Tue Apr 1 08:05:54 2008 From: mike_fischer at mac.com (Mike Fischer) Date: Tue Apr 1 08:05:09 2008 Subject: [launchd-dev] How to on demand launch for configurable port number? In-Reply-To: <20080401113459.032DB23BECC@lists.macosforge.org> References: <20080401113459.032DB23BECC@lists.macosforge.org> Message-ID: <25ECE640-1AE9-4F21-8017-100BFBA20F52@mac.com> Am 01.04.2008 um 13:34 schrieb Quinn : > At 22:15 +0100 29/3/08, Mike Fischer wrote: >> Currently I'd immagine that I need to 'launchctl stop' the service, >> modify the associated launchd.plist to reflect the currently >> configured port and then 'launchctl start' the service. > > You would probably have to "unload" and "load", rather than "stop" > and "start". Stop/start just affects the running process, so launchd > will not reconsult the relevant plist file. Right, Thanks! (I'm still learning my way around the launchd world and its terminology.) So "unload" makes launchd completely forget about a service while "load" does the reverse? >> Unless of course there is a better way that doesn't involve changing >> the launchd.plist? > > I can't think of one. OK. >> Not sure if this is relevant but the daemon does not use Bonjour at >> the moment to advertise its service. That could be added though (and >> might be a good idea for other reasons). > > If you used Bonjour, you could just bind to a ephemeral port > ("SockServiceName" == "0") and find the service, which includes the > port, using Bonjour. No need for fixed ports at all. Sounds like a good idea. I'll have to look into this. Of course the clients would then need to rely on Bonjour as well which might be difficult to achieve as the Mac OS X port of the client software is only a small part of their customer base. I'm not sure I can convince them to use Bonjour on the other platforms. There may also be issues with Bonjour normally being Link-Local in situations where the end- users have more complex networks with multiple subnets. Using Dynamic DNS Update might be difficult to implement in the field. But all this is OT on this list I guess... Thanks for your time and insight! Mike -- Mike Fischer Softwareentwicklung, EDV-Beratung Schulung, Vertrieb Web: Note: I read this list in digest mode! Send me a private copy for faster responses. From mike_fischer at mac.com Tue Apr 1 08:06:15 2008 From: mike_fischer at mac.com (Mike Fischer) Date: Tue Apr 1 08:05:27 2008 Subject: [launchd-dev] OnDemand USB Software In-Reply-To: <20080401113459.032DB23BECC@lists.macosforge.org> References: <20080401113459.032DB23BECC@lists.macosforge.org> Message-ID: <7AC2EB32-AE8E-4C2C-B277-BAFB58F9BC05@mac.com> Am 01.04.2008 um 13:34 schrieb Quinn : > At 22:02 +0100 29/3/08, Mike Fischer wrote: >> BTW: The launchd.plist(5) man page contains references to a >> launch(3) man page (10.5.2, Xcode 3.0 as well as 10.4.11, Xcode >> 2.4.1). Unfortunatly the launch(3) man page does not seem to exist. >> Filed as . I saw /usr/include/launch.h and the >> SampleD sample code but these don't really explain what is going on >> and how to properly check-in with launchd. Any hints on where to get >> more information? > > Thanks for all those bug reports. We appreciate 'em. Sure, glad to help. FWIW it came back as duplicate of which seems rather old judging by the number. > IMHO the best example of how to use launchd with a UNIX domain > socket is: > > index.html> I never would have thought to look there ;-) Interesting sample though. Thanks for the tip. >> If I understand this correctly I would not be using the socket for >> actual communication, just for triggering the launch of the >> "server", i.e. the real (on demand) daemon? > > That's the idea, yes. > >> Would I need to add the SockFamily or SockProtocol keys and if so >> what would be the correct values for a UNIX domain socket? >> Anything else I'd need to add? > > o SockFamily == Unix > > o SockPathMode is typically 438 (0666, rw-rw-rw-) -- This may not > strictly be necessary in your case because the code that's connecting > is privileged. > > o SockNodeName == ??? -- It's generally best to put this in a > privileged location (/var/run/) rather than in /tmp. OK. BetterAuthorizationSample does a good job of demonstrating this. >> In the real daemon I'd do a socket(2), bind(2), accept(2) (the >> listen(2) is already done by launchd I gather)? Or do I need this at >> all? > > In a launchd daemon you don't need to do the socket, or the bind, or > the listen. You just get a file descriptor for the socket from > launchd (using LAUNCH_KEY_CHECKIN) and accept connections from that. Ah, I see now. Makes sense in retrospect. Again thanks for your help! Mike -- Mike Fischer Softwareentwicklung, EDV-Beratung Schulung, Vertrieb Web: Note: I read this list in digest mode! Send me a private copy for faster responses. From zarzycki at apple.com Tue Apr 1 08:34:56 2008 From: zarzycki at apple.com (Dave Zarzycki) Date: Tue Apr 1 08:35:22 2008 Subject: [launchd-dev] StartupItems In-Reply-To: <00da01c89400$98feded0$cb01650a@PradipPatel> References: <00da01c89400$98feded0$cb01650a@PradipPatel> Message-ID: <90A53E28-7E45-46B5-985C-F97CA705E77E@apple.com> On Apr 1, 2008, at 6:59 AM, Pradip Patel wrote: > Is there any difference in /Library/StartupItems in MacOS 10.4 vs > 10.5 ? Pradip, Are you observing any differences? If so, what are they? davez -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.macosforge.org/pipermail/launchd-dev/attachments/20080401/ad27adef/attachment.html From pradip.patel at einfochips.com Tue Apr 1 10:02:14 2008 From: pradip.patel at einfochips.com (Pradip Patel) Date: Tue Apr 1 10:01:02 2008 Subject: [launchd-dev] StartupItems References: <00da01c89400$98feded0$cb01650a@PradipPatel> <90A53E28-7E45-46B5-985C-F97CA705E77E@apple.com> Message-ID: <00fe01c8941a$23ee9d00$cb01650a@PradipPatel> not observing, but I developed startupitem too before which run on 10.4 but not on 10.5 p2 ----- Original Message ----- From: Dave Zarzycki To: Pradip Patel Cc: launchd-dev@lists.macosforge.org Sent: Tuesday, April 01, 2008 9:04 PM Subject: Re: [launchd-dev] StartupItems On Apr 1, 2008, at 6:59 AM, Pradip Patel wrote: - This message has been scanned for viruses, spam and dangerous content and is believed to be clean. Is there any difference in /Library/StartupItems in MacOS 10.4 vs 10.5 ? Pradip, Are you observing any differences? If so, what are they? davez -- _____________________________________________________________________ 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. _____________________________________________________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.macosforge.org/pipermail/launchd-dev/attachments/20080401/02cc2d34/attachment.html From eskimo1 at apple.com Wed Apr 2 02:05:39 2008 From: eskimo1 at apple.com (Quinn) Date: Wed Apr 2 02:12:25 2008 Subject: [launchd-dev] StartupItems In-Reply-To: <00fe01c8941a$23ee9d00$cb01650a@PradipPatel> References: <00da01c89400$98feded0$cb01650a@PradipPatel> <90A53E28-7E45-46B5-985C-F97CA705E77E@apple.com> <00fe01c8941a$23ee9d00$cb01650a@PradipPatel> Message-ID: At 22:32 +0530 1/4/08, Pradip Patel wrote: >but I developed startupitem too before which run on 10.4 but not on 10.5 There have not been major changes in startup items at the launchd level. However, Mac OS X 10.5 introduced major changes to other aspects of process management, so it's easy to imagine a startup item that worked on 10.4 but didn't work on 10.5. However, without some specific information to go on, we really can't offer any specific advice. If you're looking for information about the changes in process management in 10.5, the best place to start is TN2083. Specifically, compare Figure 3 and Figure 6. S+E -- Quinn "The Eskimo!" Apple Developer Relations, Developer Technical Support, Core OS/Hardware From eskimo1 at apple.com Wed Apr 2 02:20:43 2008 From: eskimo1 at apple.com (Quinn) Date: Wed Apr 2 02:25:19 2008 Subject: [launchd-dev] How to on demand launch for configurable port number? In-Reply-To: <25ECE640-1AE9-4F21-8017-100BFBA20F52@mac.com> References: <20080401113459.032DB23BECC@lists.macosforge.org> <25ECE640-1AE9-4F21-8017-100BFBA20F52@mac.com> Message-ID: At 17:05 +0200 1/4/08, Mike Fischer wrote: >So "unload" makes launchd completely forget about a service while >"load" does the reverse? Right. S+E -- Quinn "The Eskimo!" Apple Developer Relations, Developer Technical Support, Core OS/Hardware From pradip.patel at einfochips.com Wed Apr 2 02:28:10 2008 From: pradip.patel at einfochips.com (Pradip Patel) Date: Wed Apr 2 02:27:00 2008 Subject: [launchd-dev] StartupItems References: <00da01c89400$98feded0$cb01650a@PradipPatel><90A53E28-7E45-46B5-985C-F97CA705E77E@apple.com><00fe01c8941a$23ee9d00$cb01650a@PradipPatel> Message-ID: <001f01c894a3$e2033420$cb01650a@PradipPatel> I found in log it shows : 3891612: (connectAndCheck) Untrusted apps are not allowed to connect to or launch Window Server before login. it runs success ,bt not give expected result..my application is console base ----- Original Message ----- From: "Quinn" To: Sent: Wednesday, April 02, 2008 2:35 PM Subject: Re: [launchd-dev] StartupItems > At 22:32 +0530 1/4/08, Pradip Patel wrote: >>but I developed startupitem too before which run on 10.4 but not on 10.5 > > There have not been major changes in startup items at the launchd level. > However, Mac OS X 10.5 introduced major changes to other aspects of > process management, so it's easy to imagine a startup item that worked on > 10.4 but didn't work on 10.5. However, without some specific information > to go on, we really can't offer any specific advice. > > If you're looking for information about the changes in process management > in 10.5, the best place to start is TN2083. > > > > Specifically, compare Figure 3 and Figure 6. > > S+E > -- > Quinn "The Eskimo!" > Apple Developer Relations, Developer Technical Support, Core OS/Hardware > _______________________________________________ > launchd-dev mailing list > launchd-dev@lists.macosforge.org > http://lists.macosforge.org/mailman/listinfo/launchd-dev > > - This message has been scanned for viruses, spam and dangerous content > and is believed to be clean. > -- _____________________________________________________________________ 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. _____________________________________________________________________ From eskimo1 at apple.com Wed Apr 2 02:42:09 2008 From: eskimo1 at apple.com (Quinn) Date: Wed Apr 2 02:42:56 2008 Subject: [launchd-dev] StartupItems In-Reply-To: <001f01c894a3$e2033420$cb01650a@PradipPatel> References: <00da01c89400$98feded0$cb01650a@PradipPatel> <90A53E28-7E45-46B5-985C-F97CA705E77E@apple.com> <00fe01c8941a$23ee9d00$cb01650a@PradipPatel> <001f01c894a3$e2033420$cb01650a@PradipPatel> Message-ID: At 14:58 +0530 2/4/08, Pradip Patel wrote: >I found in log it shows >: 3891612: (connectAndCheck) Untrusted apps are not allowed >to connect to or launch Window Server before login. > >it runs success ,bt not give expected result..my application is console base This is a well known issue that is documented in TN2083. Specifically, the section "Pre-Login Trust Issues". Take a look and let us know if you have any follow-up questions. Curiously, if you Google for "Untrusted apps are not allowed to connect to or launch Window Server before login", TN2083 is the second hit, and the first hit is also relevant. S+E -- Quinn "The Eskimo!" Apple Developer Relations, Developer Technical Support, Core OS/Hardware From eskimo1 at apple.com Wed Apr 2 02:44:28 2008 From: eskimo1 at apple.com (Quinn) Date: Wed Apr 2 02:45:57 2008 Subject: [launchd-dev] How to on demand launch for configurable port number? In-Reply-To: References: <20080401113459.032DB23BECC@lists.macosforge.org> <25ECE640-1AE9-4F21-8017-100BFBA20F52@mac.com> Message-ID: At 10:20 +0100 2/4/08, Quinn wrote: >At 17:05 +0200 1/4/08, Mike Fischer wrote: >>So "unload" makes launchd completely forget about a service while >>"load" does the reverse? > >Right. OK, that's was a little more succinct that I originally intended. Here's some more background: This one super-confusing part of launchd if you're coming to it from scratch. The lifecycle of a job is: load -> start -> stop -> [...] -> unload The load can be done implicitly (typically at the start of a session, for example, at startup time launchd loads all of the enabled jobs in /System/Library/LaunchDaemons) or explicitly (via "launchctl load"). Unloads, per se, only happen explicitly (via "launchctl unload"), but jobs are effectively unloaded if the session that they're loaded into dies (keep in mind that launchd's global session never dies). Similarly, the start can be done implicitly (via the RunAtLoad property, or by meeting one of your the launch-on-demand criteria, or by the KeepAlive property) or explicitly (via "launchctl start"). And a stop happens when the job quits or, explicitly, via "launchctl stop". S+E -- Quinn "The Eskimo!" Apple Developer Relations, Developer Technical Support, Core OS/Hardware From pradip.patel at einfochips.com Wed Apr 2 03:10:31 2008 From: pradip.patel at einfochips.com (Pradip Patel) Date: Wed Apr 2 03:09:17 2008 Subject: [launchd-dev] StartupItems References: <00da01c89400$98feded0$cb01650a@PradipPatel><90A53E28-7E45-46B5-985C-F97CA705E77E@apple.com><00fe01c8941a$23ee9d00$cb01650a@PradipPatel><001f01c894a3$e2033420$cb01650a@PradipPatel> Message-ID: <003801c894a9$ca088900$cb01650a@PradipPatel> I am going to read the link which you have given. just a question in mind do I have to sign the code ? or change the code ? ----- Original Message ----- From: "Quinn" To: Sent: Wednesday, April 02, 2008 3:12 PM Subject: Re: [launchd-dev] StartupItems > At 14:58 +0530 2/4/08, Pradip Patel wrote: >>I found in log it shows >>: 3891612: (connectAndCheck) Untrusted apps are not allowed to >>connect to or launch Window Server before login. >> >>it runs success ,bt not give expected result..my application is console >>base > > This is a well known issue that is documented in TN2083. > > > > Specifically, the section "Pre-Login Trust Issues". Take a look and let > us know if you have any follow-up questions. > > Curiously, if you Google for "Untrusted apps are not allowed to connect to > or launch Window Server before login", TN2083 is the second hit, and the > first hit is also relevant. > > S+E > -- > Quinn "The Eskimo!" > Apple Developer Relations, Developer Technical Support, Core OS/Hardware > _______________________________________________ > launchd-dev mailing list > launchd-dev@lists.macosforge.org > http://lists.macosforge.org/mailman/listinfo/launchd-dev > > - This message has been scanned for viruses, spam and dangerous content > and is believed to be clean. > -- _____________________________________________________________________ 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. _____________________________________________________________________ From eskimo1 at apple.com Wed Apr 2 03:37:23 2008 From: eskimo1 at apple.com (Quinn) Date: Wed Apr 2 03:46:19 2008 Subject: [launchd-dev] StartupItems In-Reply-To: <003801c894a9$ca088900$cb01650a@PradipPatel> References: <00da01c89400$98feded0$cb01650a@PradipPatel> <90A53E28-7E45-46B5-985C-F97CA705E77E@apple.com> <00fe01c8941a$23ee9d00$cb01650a@PradipPatel> <001f01c894a3$e2033420$cb01650a@PradipPatel> <003801c894a9$ca088900$cb01650a@PradipPatel> Message-ID: At 15:40 +0530 2/4/08, Pradip Patel wrote: >do I have to sign the code ? No. To quote from the technote: If, in Mac OS X 10.5 and later, you see a message like that shown in Listing 9 you might mistakenly think that the solution is to get the system to 'trust' your application, perhaps via code signing. However, this isn't the case. This message is really telling you is that you're trying to connect to the window server from the wrong context. You see this message if you try to connect to the global window server service from outside of the pre-login context before the user has logged in; typically this means that you're trying to use the window server from a daemon. >or change the code ? Yes. Again, to quote from the technote: You should not attempt to fix this by convincing the window server to trust your program; doing so will just cause other problems further down the road. For example, if you do successfully connect to the window server from your daemon, you still have to deal with window server lifecycle issues described previously. Instead, you should fix this problem by changing your code to run in the correct context. If you need to connect to the window server in a pre-login context, create a pre-login launchd agent. For an example of this, see Sample Code Project 'PreLoginAgents'. S+E -- Quinn "The Eskimo!" Apple Developer Relations, Developer Technical Support, Core OS/Hardware From pradip.patel at einfochips.com Wed Apr 2 23:32:10 2008 From: pradip.patel at einfochips.com (Pradip Patel) Date: Wed Apr 2 23:30:52 2008 Subject: [launchd-dev] StartupItems Message-ID: <004201c89554$73f7a4a0$cb01650a@PradipPatel> first Thanks My application is console base...so how is going to connect windowserver ? May be i am using CGDisplayCurrentMode API of Quartz ? How can I get main screen resolution with such api which is not interact with window server ? can you please tell me such API ? if i made my application trusted then above quartz API get success ? p2 ----- Original Message ----- From: "Quinn" To: Sent: Wednesday, April 02, 2008 4:07 PM Subject: Re: [launchd-dev] StartupItems > At 15:40 +0530 2/4/08, Pradip Patel wrote: >>do I have to sign the code ? > > No. To quote from the technote: > > If, in Mac OS X 10.5 and later, you see a message like > that shown in Listing 9 you might mistakenly think that > the solution is to get the system to 'trust' your > application, perhaps via code signing. > > However, this isn't the case. This message is really > telling you is that you're trying to connect to the > window server from the wrong context. You see this > message if you try to connect to the global window > server service from outside of the pre-login context > before the user has logged in; typically this means that > you're trying to use the window server from a daemon. > >>or change the code ? > > Yes. Again, to quote from the technote: > > You should not attempt to fix this by convincing the > window server to trust your program; doing so will just > cause other problems further down the road. For example, > if you do successfully connect to the window server from > your daemon, you still have to deal with window server > lifecycle issues described previously. > > Instead, you should fix this problem by changing your > code to run in the correct context. If you need to > connect to the window server in a pre-login context, > create a pre-login launchd agent. For an example of > this, see Sample Code Project 'PreLoginAgents'. > > S+E > -- > Quinn "The Eskimo!" > Apple Developer Relations, Developer Technical Support, Core OS/Hardware > _______________________________________________ > launchd-dev mailing list > launchd-dev@lists.macosforge.org > http://lists.macosforge.org/mailman/listinfo/launchd-dev > > - This message has been scanned for viruses, spam and dangerous content > and is believed to be clean. > -- _____________________________________________________________________ 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. _____________________________________________________________________ From pradip.patel at einfochips.com Wed Apr 2 23:34:17 2008 From: pradip.patel at einfochips.com (Pradip Patel) Date: Wed Apr 2 23:32:57 2008 Subject: [launchd-dev] launch Agent Message-ID: <004b01c89554$bf928060$cb01650a@PradipPatel> Hi Is LaunchAgent work on non-admin mode ? which permissing i have to set for it on 10.5 ? 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. _____________________________________________________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.macosforge.org/pipermail/launchd-dev/attachments/20080403/f0abf476/attachment.html From mike_fischer at mac.com Thu Apr 3 03:53:41 2008 From: mike_fischer at mac.com (Mike Fischer) Date: Thu Apr 3 03:52:35 2008 Subject: [launchd-dev] How to on demand launch for configurable port number? In-Reply-To: <20080403063053.E262A23D69E@lists.macosforge.org> References: <20080403063053.E262A23D69E@lists.macosforge.org> Message-ID: <02DFD0FA-2580-4D65-9715-D4583951358B@mac.com> Am 03.04.2008 um 08:30 schrieb Quinn : > > At 10:20 +0100 2/4/08, Quinn wrote: >> At 17:05 +0200 1/4/08, Mike Fischer wrote: >>> So "unload" makes launchd completely forget about a service while >>> "load" does the reverse? >> >> Right. > > OK, that's was a little more succinct that I originally intended. :-) Would have helped on it's own though. I was just making sure I understood because some experiments I did with a custom Launch Agent to create a system profile report once per day (for having it handy when filing bug reports) seemed to make it necessary to logout/login to make it work. I tried unload/load (I think) without success but I didn't document my exact steps to get it to work. I'll just mark this off as experimenting with too many unknown variables and too little knowledge. The Launch Agent now works btw. > Here's some more background: > > This one super-confusing part of launchd if you're coming to it from > scratch. The lifecycle of a job is: > > load -> start -> stop -> [...] -> unload > > The load can be done implicitly (typically at the start of a session, > for example, at startup time launchd loads all of the enabled jobs in > /System/Library/LaunchDaemons) or explicitly (via "launchctl load"). > Unloads, per se, only happen explicitly (via "launchctl unload"), but > jobs are effectively unloaded if the session that they're loaded into > dies (keep in mind that launchd's global session never dies). > > Similarly, the start can be done implicitly (via the RunAtLoad > property, or by meeting one of your the launch-on-demand criteria, or > by the KeepAlive property) or explicitly (via "launchctl start"). > And a stop happens when the job quits or, explicitly, via "launchctl > stop". Thanks for the very clear explanation. Mike -- Mike Fischer Softwareentwicklung, EDV-Beratung Schulung, Vertrieb Note: I read this list in digest mode! Send me a private copy for faster responses. From richard at scl.utah.edu Wed Apr 9 18:01:02 2008 From: richard at scl.utah.edu (Richard Glaser) Date: Wed Apr 9 18:02:07 2008 Subject: [launchd-dev] launchd support ranges for StartCalendarInterval? Message-ID: <324D9A05-70F7-4127-B731-AD11A4FCE40A@scl.utah.edu> Hello Dave: Emailed this answer in the past and I was wondering if he or someone else would be willing to email out a example for a range of hours by having StartCalendarInterval be an array of dictionaries instead of just a dictionary... Would it be something like this.? StartCalendarInterval Hour 4 Minute 0 Weekday 0 Hour 5 Minute 0 Weekday 0 For every range of hours? > Yes, you can do this. Have StartCalendarInterval be an array of > dictionaries instead of just a dictionary within the configuration > file. Having said that, it would be nice if launchd natively supported > some of the common calendar expressions such as > {first,second,third,forth,last,second-to-last} > {mon,tue,wed,thr,fri,sat,sun}. Doing so would save people the trouble > of figuring out the ranges. > > Feel free to file an enhancement request, > > davez > > P.S. -- I've occasionally wanted, just for giggles, to have launchd to > support other time intervals such as "only during leap years" or the > ability to schedule jobs based on the phase of the moon, or the > solstices/equinoxes. I've even considered adding planetary alignment > to the schema. :-P Thanks: Richard Glaser University of Utah - Student Computing Labs richard@scl.utah.edu 801-585-8016 From ajmas at sympatico.ca Fri Apr 18 16:42:21 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Fri Apr 18 16:40:01 2008 Subject: [launchd-dev] Launching tunnel driver with launchd? Message-ID: <240C41BE-D4A9-4EEE-9682-2CA328319C57@sympatico.ca> Hi, I have a daemon that depends on a tunnel driver to be loaded, for it to be able to function. Both are currently using StartupItems, so I would like to migrate them to use launchd. The daemon is aiccu, a 6to4 tunnel, and the driver is tun/tap. What I would like to know is what is the right way to loading the tun/ tap driver with launchd, if launchd is the right mechanism for this? For the aiccu side, it would appear that the SampleD example: http://developer.apple.com/samplecode/SampleD/index.html would be my point of reference. Any help would be appreciated. Andre From jim.correia at pobox.com Tue Apr 22 07:19:11 2008 From: jim.correia at pobox.com (Jim Correia) Date: Tue Apr 22 07:16:35 2008 Subject: [launchd-dev] launchd - how to specify daemon needs to wait for network to start? Message-ID: <43D4BDD3-9FF7-4E85-872C-03E48ABD0C47@pobox.com> I'm upgrading a server from 10.4 to 10.5 server. This server runs p4d (which really wants to listen/fork itself - there are restrictions on (x)inetd compatibility mode), and a handful of other jobs which should only be running after the p4d daemon has started. Currently, the launchd job is specified like this: KeepAlive NetworkState Label com.perforce.p4d ProgramArguments /usr/local/bin/p4d ... It appears that p4d is first launched before the network interface is up. (The error information in the log isn't extremely verbose. It looks like it is trying to bind to the address in the license file, and this fails.) After one or more respawn attempts, the server comes. What is the correct way to spec the job? Jim From zarzycki at apple.com Tue Apr 22 08:55:53 2008 From: zarzycki at apple.com (Dave Zarzycki) Date: Tue Apr 22 08:54:16 2008 Subject: [launchd-dev] launchd - how to specify daemon needs to wait for network to start? In-Reply-To: <43D4BDD3-9FF7-4E85-872C-03E48ABD0C47@pobox.com> References: <43D4BDD3-9FF7-4E85-872C-03E48ABD0C47@pobox.com> Message-ID: Jim, The correct way is to modify the p4d to utilize the SystemConfiguration framework that Apple provides. That will let a developer monitor all forms of network state transitions. If that is temporarily impractical, one can wrap the invocation of p4d with a shell script: #!/bin/sh # ipconfig "waitall" might go away in a future release. # we really need p4d to adopt the SystemConfiguration framework /usr/sbin/ipconfig waitall exec /usr/local/bin/p4d davez On Apr 22, 2008, at 7:19 AM, Jim Correia wrote: > I'm upgrading a server from 10.4 to 10.5 server. This server runs > p4d (which really wants to listen/fork itself - there are > restrictions on (x)inetd compatibility mode), and a handful of other > jobs which should only be running after the p4d daemon has started. > > Currently, the launchd job is specified like this: > > > "> > > > KeepAlive > > NetworkState > > > Label > com.perforce.p4d > ProgramArguments > > /usr/local/bin/p4d > ... > > > > > It appears that p4d is first launched before the network interface > is up. (The error information in the log isn't extremely verbose. It > looks like it is trying to bind to the address in the license file, > and this fails.) After one or more respawn attempts, the server comes. > > What is the correct way to spec the job? > > Jim > _______________________________________________ > launchd-dev mailing list > launchd-dev@lists.macosforge.org > http://lists.macosforge.org/mailman/listinfo/launchd-dev From jim.correia at pobox.com Tue Apr 22 09:07:02 2008 From: jim.correia at pobox.com (Jim Correia) Date: Tue Apr 22 09:05:43 2008 Subject: [launchd-dev] launchd - how to specify daemon needs to wait for network to start? In-Reply-To: References: <43D4BDD3-9FF7-4E85-872C-03E48ABD0C47@pobox.com> Message-ID: On Apr 22, 2008, at 11:55 AM, Dave Zarzycki wrote: > The correct way is to modify the p4d to utilize the > SystemConfiguration framework that Apple provides. That will let a > developer monitor all forms of network state transitions. If that is > temporarily impractical, one can wrap the invocation of p4d with a > shell script: > > #!/bin/sh > > # ipconfig "waitall" might go away in a future release. > # we really need p4d to adopt the SystemConfiguration framework > /usr/sbin/ipconfig waitall > > exec /usr/local/bin/p4d Thanks Dave, that solves the problem. Modifying p4d is impractical since it is closed source commercial software that we license. I'm currently on an older release. If the current release has the same issue, I'll log an enhancement request with Perforce. Jim From stark at jeamland.ca Tue Apr 22 10:05:00 2008 From: stark at jeamland.ca (Dana Lacoste) Date: Tue Apr 22 10:03:39 2008 Subject: [launchd-dev] launchd - how to specify daemon needs to wait for network to start? In-Reply-To: References: <43D4BDD3-9FF7-4E85-872C-03E48ABD0C47@pobox.com> Message-ID: <29BBB4C4-DD73-4684-B724-C0C71495D23F@jeamland.ca> Though I've not used it on Mac OS, as a perforce admin I can definitely state that this is how perforce will continue to work: It's hard licensed to an IP address, so if that IP address does not exist on the server when the server is started, the licensing will fail, which is what you're seeing. (This is fairly common for commercial software: perhaps we can write something that DOES use SystemConfiguration as a generic exec wrapper?) (Note that the issue is only that the IP has to exist at process license verification: it'll still bind to *, so it doesn't need to ALWAYS exist, it only needs to exist at startup, so the wrapper (or the waitall wrapper below) should be fine.....) Dana Lacoste On Apr 22, 2008, at 09:07, Jim Correia wrote: > On Apr 22, 2008, at 11:55 AM, Dave Zarzycki wrote: > >> The correct way is to modify the p4d to utilize the >> SystemConfiguration framework that Apple provides. That will let a >> developer monitor all forms of network state transitions. If that >> is temporarily impractical, one can wrap the invocation of p4d with >> a shell script: >> >> #!/bin/sh >> >> # ipconfig "waitall" might go away in a future release. >> # we really need p4d to adopt the SystemConfiguration framework >> /usr/sbin/ipconfig waitall >> >> exec /usr/local/bin/p4d > > Thanks Dave, that solves the problem. > > Modifying p4d is impractical since it is closed source commercial > software that we license. I'm currently on an older release. If the > current release has the same issue, I'll log an enhancement request > with Perforce. > > Jim > > _______________________________________________ > launchd-dev mailing list > launchd-dev@lists.macosforge.org > http://lists.macosforge.org/mailman/listinfo/launchd-dev From marit at agnes.gsfc.nasa.gov Thu Apr 24 07:31:24 2008 From: marit at agnes.gsfc.nasa.gov (marit) Date: Thu Apr 24 07:28:42 2008 Subject: [launchd-dev] Path monitoring failed Message-ID: <170F083C-3E93-40EA-BDCF-96D654A20FAA@agnes.gsfc.nasa.gov> I have some launchd plists with WatchPaths that are watching directories on non-boot (but local internal SATA) drives. On 10.4 the watchpaths worked ok, but on 10.5.2, they are failing to load on boot. They do load and run correctly if I wait until after boot and load them manually with launchctl. Here is the section of syslog showing that "path monitoring failed" during startup: Apr 4 08:27:18 macgoesall com.apple.loginwindow[33]: System shutdown time has arrived Apr 4 08:27:44 localhost kernel[0]: npvhash=4095 Apr 4 08:27:42 localhost com.apple.launchctl.System[2]: /dev/disk0s3 on / (hfs, local, journaled) Apr 4 08:27:44 localhost com.apple.launchctl.System[2]: launchctl: Please convert the following to launchd: /etc/mach_init.d/chum.plist Apr 4 08:27:44 localhost com.apple.launchctl.System[2]: launchctl: Please convert the following to launchd: /etc/mach_init.d/ dashboardadvisoryd.plist Apr 4 08:27:44 localhost com.apple.launchctl.System[2]: launchctl: Please convert the following to launchd: /etc/mach_init.d/ pilotfish.plist Apr 4 08:27:44 localhost com.apple.launchd[1] (com.apple.distccdConfigd): Unknown key: SHAuthorizationRight Apr 4 08:27:44 localhost com.apple.launchd[1] (org.cups.cupsd): Unknown key: SHAuthorizationRight Apr 4 08:27:44 localhost com.apple.launchd[1] (org.ntp.ntpd): Unknown key: SHAuthorizationRight Apr 4 08:27:44 localhost com.apple.launchd[1] (gov.nasa.gv_age_color_east): Path monitoring failed on "/Volumes/HD3/ color/east_out/hurricane2": No such file or directory Am I missing some launchd configuration that will fix this problem? This seems like something that could be solved if OnDemand could use the PathState key that KeepAlive has. Anyway, I finally modified my program to create files on the boot disk just for for launchd to watch and with that modification the path monitoring works fine; however I'd prefer not to have that added feature in my code since it just adds another directory that has to be created, passed into the program, cleaned, etc marit From zarzycki at apple.com Mon Apr 28 18:54:48 2008 From: zarzycki at apple.com (Dave Zarzycki) Date: Mon Apr 28 18:53:13 2008 Subject: [launchd-dev] Path monitoring failed In-Reply-To: <170F083C-3E93-40EA-BDCF-96D654A20FAA@agnes.gsfc.nasa.gov> References: <170F083C-3E93-40EA-BDCF-96D654A20FAA@agnes.gsfc.nasa.gov> Message-ID: <58643DBD-7105-40B7-B62F-FF5A2336EFA7@apple.com> Marit, Launchd supposedly rechecks path monitoring checks every time the mount table is updated. Unfortunately, we don't log the transition from "it wasn't working" to "it now is being monitored" state. Is this genuinely not working for you? Or is the log message just concerning you? davez On Apr 24, 2008, at 7:31 AM, marit wrote: > > I have some launchd plists with WatchPaths that are watching > directories on non-boot (but local internal SATA) drives. On 10.4 > the watchpaths worked ok, but on 10.5.2, they are failing to load on > boot. They do load and run correctly if I wait until after boot and > load them manually with launchctl. Here is the section of syslog > showing that "path monitoring failed" during startup: > > > Apr 4 08:27:18 macgoesall com.apple.loginwindow[33]: System > shutdown time has arrived > Apr 4 08:27:44 localhost kernel[0]: npvhash=4095 > Apr 4 08:27:42 localhost com.apple.launchctl.System[2]: /dev/ > disk0s3 on / (hfs, local, journaled) > Apr 4 08:27:44 localhost com.apple.launchctl.System[2]: launchctl: > Please convert the following to launchd: /etc/mach_init.d/chum.plist > Apr 4 08:27:44 localhost com.apple.launchctl.System[2]: launchctl: > Please convert the following to launchd: /etc/mach_init.d/ > dashboardadvisoryd.plist > Apr 4 08:27:44 localhost com.apple.launchctl.System[2]: launchctl: > Please convert the following to launchd: /etc/mach_init.d/ > pilotfish.plist > Apr 4 08:27:44 localhost com.apple.launchd[1] > (com.apple.distccdConfigd): Unknown key: SHAuthorizationRight > Apr 4 08:27:44 localhost com.apple.launchd[1] (org.cups.cupsd): > Unknown key: SHAuthorizationRight > Apr 4 08:27:44 localhost com.apple.launchd[1] (org.ntp.ntpd): > Unknown key: SHAuthorizationRight > Apr 4 08:27:44 localhost com.apple.launchd[1] > (gov.nasa.gv_age_color_east): Path monitoring failed on "/Volumes/ > HD3/color/east_out/hurricane2": No such file or directory > > > Am I missing some launchd configuration that will fix this problem? > This seems like something that could be solved if OnDemand could use > the PathState key that KeepAlive has. > > Anyway, I finally modified my program to create files on the boot > disk just for for launchd to watch and with that modification the > path monitoring works fine; however I'd prefer not to have that > added feature in my code since it just adds another directory that > has to be created, passed into the program, cleaned, etc > > marit > > > > > > _______________________________________________ > launchd-dev mailing list > launchd-dev@lists.macosforge.org > http://lists.macosforge.org/mailman/listinfo/launchd-dev From marit at agnes.gsfc.nasa.gov Tue Apr 29 07:58:03 2008 From: marit at agnes.gsfc.nasa.gov (marit) Date: Tue Apr 29 07:54:59 2008 Subject: Fwd: [launchd-dev] Path monitoring failed References: <58643DBD-7105-40B7-B62F-FF5A2336EFA7@apple.com> Message-ID: It's not working - otherwise, I wouldn't have spent the time to come up with a workaround. However there's also now a possible confounding hardware problem. We have all 4 internal SATA drive bays populated and use 1 disk for system and 3 for data. Launchd has not been able to monitor watchpaths on two of the data disks (i didn't test the third) for a couple of months, but recently one of those two data disks has started experiencing timeouts. It seems possible that the failing drive could be affecting the neighboring drive's bus/controller/??? So maybe it's only a hardware problem and not a launchd problem at all. I'm going to wait until the disk is replaced before doing anything more with launchd. > Marit, > > Launchd supposedly rechecks path monitoring checks every time the > mount table is updated. Unfortunately, we don't log the transition > from "it wasn't working" to "it now is being monitored" state. Is > this genuinely not working for you? Or is the log message just > concerning you? > > davez