From huntc at internode.on.net Wed Feb 28 03:29:41 2007 From: huntc at internode.on.net (Christopher Hunt) Date: Wed Feb 28 03:39:37 2007 Subject: [launchd-dev] launchd/osascript kiosk behaviour Message-ID: <19940EAA-50E3-4614-BA7C-FD569B3934F0@internode.on.net> Hi there, Please forgive me if this is an inappropriate place to post an observation of launchd that I'm finding hard to understand. Please also feel free to direct me elsewhere as necessary. I'm trying to execute osascript -e via launchd and it reports an error (an abort) in the system.log file. More specifically: launchd[4108]: com.classactionpl.restartvision: exited abnormally: Abort trap Others item of interest: - the user I'm logged in under has not launched the Finder - it is a kiosk style of user where a custom application is launched in place of the Finder. - my plist is under the ~/Library/LaunchAgents i.e. the user's launch agent's directory - all is well if I perform the same osascript command from within the same user's crontab - all is well if I perform the same osascript command from the command line One particular item of interest is: if I "launchd bash", load the plists and the start the job, the osascript command works! So why shouldn't the command work outside of this? Here's the plist I'm using: Debug Label com.classactionpl.restartvision OnDemand ProgramArguments osascript -e tell application "World" to quit StartCalendarInterval Hour 0 Minute 0 Debug etc. doesn't yield more info. 'hoping that someone can help. Kind regards, Christopher From huntc at internode.on.net Wed Feb 28 04:27:31 2007 From: huntc at internode.on.net (Christopher Hunt) Date: Wed Feb 28 04:37:25 2007 Subject: [launchd-dev] Re: launchd/osascript kiosk behaviour In-Reply-To: <19940EAA-50E3-4614-BA7C-FD569B3934F0@internode.on.net> References: <19940EAA-50E3-4614-BA7C-FD569B3934F0@internode.on.net> Message-ID: <7BC9B192-DB6C-4F86-A61C-98D3E4C8320A@internode.on.net> A quick follow-up with more info: I managed to re-direct the output of stderr to a file via launchd (very handy option that one): 2007-02-28 22:38:10.503 osascript[9069] CFLog (0): CFMessagePort: bootstrap_register(): failed 1100 (0x44c), port = 0x2103, name = 'Processes-0.35782657' See /usr/include/servers/bootstrap_defs.h for the error codes. 2007-02-28 22:38:10.511 osascript[9069] CFLog (99): CFMessagePortCreateLocal(): failed to name Mach port (Processes-0.35782657) CFMessagePortCreateLocal failed (name = Processes-0.35782657 error = 0) The error code 1100 equates to BOOTSTRAP_NOT_PRIVILEGED. This is all that I could find on this error: *** A deactivated bootstrap namespace allows you to look up services, but it does not allow you to register new services. Any attempt to register a service in a deactivate namespace will fail with an error BOOTSTRAP_NOT_PRIVILEGED (1100). Similarly, any high-level wrapper that registers a service will fail. For example, CFMessagePortCreateLocal will print an error message and return NULL if you call it after your namespace has been deactivated. *** Any ideas? Cheers, -C On 28/02/2007, at 10:29 PM, Christopher Hunt wrote: > Hi there, > > Please forgive me if this is an inappropriate place to post an > observation of launchd that I'm finding hard to understand. Please > also feel free to direct me elsewhere as necessary. > > I'm trying to execute osascript -e via launchd and it > reports an error (an abort) in the system.log file. More specifically: > > launchd[4108]: com.classactionpl.restartvision: exited abnormally: > Abort trap > > Others item of interest: > - the user I'm logged in under has not launched the Finder - it is > a kiosk style of user where a custom application is launched in > place of the Finder. > - my plist is under the ~/Library/LaunchAgents i.e. the user's > launch agent's directory > - all is well if I perform the same osascript command from within > the same user's crontab > - all is well if I perform the same osascript command from the > command line > > One particular item of interest is: if I "launchd bash", load the > plists and the start the job, the osascript command works! So why > shouldn't the command work outside of this? > > Here's the plist I'm using: > > > "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> > > > Debug > > Label > com.classactionpl.restartvision > OnDemand > > ProgramArguments > > osascript > -e > tell application "World" to quit > > StartCalendarInterval > > Hour > 0 > Minute > 0 > > > > > Debug etc. doesn't yield more info. > > 'hoping that someone can help. > > Kind regards, > Christopher From zarzycki at apple.com Wed Feb 28 05:48:15 2007 From: zarzycki at apple.com (Dave Zarzycki) Date: Wed Feb 28 05:58:09 2007 Subject: [launchd-dev] launchd/osascript kiosk behaviour In-Reply-To: <19940EAA-50E3-4614-BA7C-FD569B3934F0@internode.on.net> References: <19940EAA-50E3-4614-BA7C-FD569B3934F0@internode.on.net> Message-ID: <82C78379-B189-4DD7-8CEA-62A3C24D3E72@apple.com> Known bug in Tiger, and fixed in Leopard. For most practical purposes, LaunchAgents don't function as advertised in Tiger. Sorry, davez On Feb 28, 2007, at 3:29 AM, Christopher Hunt wrote: > Hi there, > > Please forgive me if this is an inappropriate place to post an > observation of launchd that I'm finding hard to understand. Please > also feel free to direct me elsewhere as necessary. > > I'm trying to execute osascript -e via launchd and it > reports an error (an abort) in the system.log file. More specifically: > > launchd[4108]: com.classactionpl.restartvision: exited abnormally: > Abort trap > > Others item of interest: > - the user I'm logged in under has not launched the Finder - it is a > kiosk style of user where a custom application is launched in place > of the Finder. > - my plist is under the ~/Library/LaunchAgents i.e. the user's > launch agent's directory > - all is well if I perform the same osascript command from within > the same user's crontab > - all is well if I perform the same osascript command from the > command line > > One particular item of interest is: if I "launchd bash", load the > plists and the start the job, the osascript command works! So why > shouldn't the command work outside of this? > > Here's the plist I'm using: > > > "> > > > Debug > > Label > com.classactionpl.restartvision > OnDemand > > ProgramArguments > > osascript > -e > tell application "World" to quit > > StartCalendarInterval > > Hour > 0 > Minute > 0 > > > > > Debug etc. doesn't yield more info. > > 'hoping that someone can help. > > Kind regards, > Christopher > _______________________________________________ > launchd-dev mailing list > launchd-dev@lists.macosforge.org > http://lists.macosforge.org/mailman/listinfo/launchd-dev From huntc at internode.on.net Wed Feb 28 12:55:48 2007 From: huntc at internode.on.net (Christopher Hunt) Date: Wed Feb 28 13:05:49 2007 Subject: [launchd-dev] launchd/osascript kiosk behaviour In-Reply-To: <82C78379-B189-4DD7-8CEA-62A3C24D3E72@apple.com> References: <19940EAA-50E3-4614-BA7C-FD569B3934F0@internode.on.net> <82C78379-B189-4DD7-8CEA-62A3C24D3E72@apple.com> Message-ID: <4F331950-56EF-452B-9976-FE5CA9985583@internode.on.net> On 01/03/2007, at 12:48 AM, Dave Zarzycki wrote: > Known bug in Tiger, and fixed in Leopard. > > For most practical purposes, LaunchAgents don't function as > advertised in Tiger. > > Sorry, That's ok! This is really good to know and knowing this will save me a great deal of effort. I presume that you're talking about both ~/ Library/LaunchAgents (what I'm using) and /Library/LaunchAgents i.e. simply avoid LaunchAgents altogether in Tiger? Cheers, -C From zarzycki at apple.com Wed Feb 28 13:04:09 2007 From: zarzycki at apple.com (Dave Zarzycki) Date: Wed Feb 28 13:14:00 2007 Subject: [launchd-dev] launchd/osascript kiosk behaviour In-Reply-To: <4F331950-56EF-452B-9976-FE5CA9985583@internode.on.net> References: <19940EAA-50E3-4614-BA7C-FD569B3934F0@internode.on.net> <82C78379-B189-4DD7-8CEA-62A3C24D3E72@apple.com> <4F331950-56EF-452B-9976-FE5CA9985583@internode.on.net> Message-ID: On Feb 28, 2007, at 12:55 PM, Christopher Hunt wrote: > On 01/03/2007, at 12:48 AM, Dave Zarzycki wrote: > >> Known bug in Tiger, and fixed in Leopard. >> >> For most practical purposes, LaunchAgents don't function as >> advertised in Tiger. >> >> Sorry, > That's ok! This is really good to know and knowing this will save me > a great deal of effort. I presume that you're talking about both ~/ > Library/LaunchAgents (what I'm using) and /Library/LaunchAgents i.e. > simply avoid LaunchAgents altogether in Tiger? Yup. davez From huntc at internode.on.net Wed Feb 28 14:27:39 2007 From: huntc at internode.on.net (Christopher Hunt) Date: Wed Feb 28 14:37:38 2007 Subject: [launchd-dev] launchd/osascript kiosk behaviour In-Reply-To: References: <19940EAA-50E3-4614-BA7C-FD569B3934F0@internode.on.net> <82C78379-B189-4DD7-8CEA-62A3C24D3E72@apple.com> <4F331950-56EF-452B-9976-FE5CA9985583@internode.on.net> Message-ID: <226F929D-4CF8-41E8-BE43-77177CCDFB33@internode.on.net> Hi again Dave, Thanks for this invaluable dialogue. It is obvious that some aspects of launch agents do work - can you summarise the problem with them on Tiger? Cheers, -C On 01/03/2007, at 8:04 AM, Dave Zarzycki wrote: > On Feb 28, 2007, at 12:55 PM, Christopher Hunt wrote: > >> On 01/03/2007, at 12:48 AM, Dave Zarzycki wrote: >> >>> Known bug in Tiger, and fixed in Leopard. >>> >>> For most practical purposes, LaunchAgents don't function as >>> advertised in Tiger. >>> >>> Sorry, >> That's ok! This is really good to know and knowing this will save >> me a great deal of effort. I presume that you're talking about >> both ~/Library/LaunchAgents (what I'm using) and /Library/ >> LaunchAgents i.e. simply avoid LaunchAgents altogether in Tiger? > > Yup. From zarzycki at apple.com Wed Feb 28 14:34:43 2007 From: zarzycki at apple.com (Dave Zarzycki) Date: Wed Feb 28 14:44:41 2007 Subject: [launchd-dev] launchd/osascript kiosk behaviour In-Reply-To: <226F929D-4CF8-41E8-BE43-77177CCDFB33@internode.on.net> References: <19940EAA-50E3-4614-BA7C-FD569B3934F0@internode.on.net> <82C78379-B189-4DD7-8CEA-62A3C24D3E72@apple.com> <4F331950-56EF-452B-9976-FE5CA9985583@internode.on.net> <226F929D-4CF8-41E8-BE43-77177CCDFB33@internode.on.net> Message-ID: You can use them as long as you never logout. davez On Feb 28, 2007, at 2:27 PM, Christopher Hunt wrote: > Hi again Dave, > > Thanks for this invaluable dialogue. > > It is obvious that some aspects of launch agents do work - can you > summarise the problem with them on Tiger? > > Cheers, > -C > > On 01/03/2007, at 8:04 AM, Dave Zarzycki wrote: > >> On Feb 28, 2007, at 12:55 PM, Christopher Hunt wrote: >> >> >>> On 01/03/2007, at 12:48 AM, Dave Zarzycki wrote: >> >>> >> >>> >>>> Known bug in Tiger, and fixed in Leopard. >> >>> >>>> >> >>> >>>> For most practical purposes, LaunchAgents don't function as >>>> advertised in Tiger. >> >>> >>>> >> >>> >>>> Sorry, >> >>> That's ok! This is really good to know and knowing this will save >>> me a great deal of effort. I presume that you're talking about >>> both ~/Library/LaunchAgents (what I'm using) and /Library/ >>> LaunchAgents i.e. simply avoid LaunchAgents altogether in Tiger? >> >> Yup.