Re: Problems with Launchd Daemon
Re: Problems with Launchd Daemon
- Subject: Re: Problems with Launchd Daemon
- From: John Clayton <email@hidden>
- Date: Mon, 28 Apr 2008 22:49:36 +0200
Hi All,
It can be done, with caveats. For an example, heres a developer
example showing how a banner can be displayed on login, and that links
with Cocoa.framework:
/Developer/Examples/Security/bannersample
However, caveat 1: This is actually an Authorization Plugin, and as
such hooks into a well documented chain of software running in the
login context.
As others have already suggested - you should read (twice) the docs on
launchd, the daemon and agent plist settings - and really get to know
this material. E.g. if you can answer questions about the session
security contexts blindfolded, you are ready to begin [young master].
Think carefully about this, Apple changed this in Leopard for good
reasons - mostly security related. Ask yourself really carefully if
your app *has* to be a GUI app that runs in the login context.
Have fun, and read the sample code - it takes you a long way toward
the solution.
--
john clayton
On 28/04/2008, at 9:26 PM, Dave Camp wrote:
On Apr 28, 2008, at 12:00 PM, JanakiRam wrote:
I am developing a Mac cocoa application suite which has a launchd
daemon (
which is a pure cocoa application ).
I'm able to launch the cocoa daemon using launchctl command
properly. But
when i place the plist in /Librart/LaunchDaemons ,after system
restart ,
my system log shows the following error. And my application
behavior is
unexpected.
*<Warning>: 3891612: (CGSLookupServerRootPort) Untrusted apps are not
allowed to connect to or launch Window Server before login.*
*<Error>: kCGErrorRangeCheck : On-demand launch of the Window
Server is
allowed for root user only.*
*_RegisterApplication(), FAILED TO establish the default connection
to the
WindowServer,_CGSDefaultConnection() is NULL. *
Activity Monitor shows my daemon is running with root privileges.
Can any one help me to solve this problem. Please help me to solve
this
problem.
You should read <http://developer.apple.com/technotes/tn2005/tn2083.html
>, if you have not already.
You can write a daemon in Objective-C and use Foundation and other
daemon safe frameworks, but you can't use AppKit or the Cocoa
framework. It's hard to tell what you mean by "pure cocoa"
application.
Dave
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
@mac.com
This email sent to email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden