[launchd-dev] Re: launchd/osascript kiosk behaviour
Christopher Hunt
huntc at internode.on.net
Wed Feb 28 04:27:31 PST 2007
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
More information about the launchd-dev
mailing list