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 <command> 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: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http:// www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>Debug</key> <true/> <key>Label</key> <string>com.classactionpl.restartvision</string> <key>OnDemand</key> <true/> <key>ProgramArguments</key> <array> <string>osascript</string> <string>-e</string> <string>tell application "World" to quit</string> </array> <key>StartCalendarInterval</key> <dict> <key>Hour</key> <integer>0</integer> <key>Minute</key> <integer>0</integer> </dict> </dict> </plist> Debug etc. doesn't yield more info. 'hoping that someone can help. Kind regards, Christopher
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 <command> 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:
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>Debug</key> <true/> <key>Label</key> <string>com.classactionpl.restartvision</string> <key>OnDemand</key> <true/> <key>ProgramArguments</key> <array> <string>osascript</string> <string>-e</string> <string>tell application "World" to quit</string> </array> <key>StartCalendarInterval</key> <dict> <key>Hour</key> <integer>0</integer> <key>Minute</key> <integer>0</integer> </dict> </dict> </plist>
Debug etc. doesn't yield more info.
'hoping that someone can help.
Kind regards, Christopher
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 <command> 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:
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd "> <plist version="1.0"> <dict> <key>Debug</key> <true/> <key>Label</key> <string>com.classactionpl.restartvision</string> <key>OnDemand</key> <true/> <key>ProgramArguments</key> <array> <string>osascript</string> <string>-e</string> <string>tell application "World" to quit</string> </array> <key>StartCalendarInterval</key> <dict> <key>Hour</key> <integer>0</integer> <key>Minute</key> <integer>0</integer> </dict> </dict> </plist>
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
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
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
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.
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.
participants (2)
-
Christopher Hunt
-
Dave Zarzycki