HI Jen, Thanks for the initial reply.
I've tried to unload my launch daemon from shell , it is unloading without any error. *$ sudo lauchctl unload -w /Library/LaunchDaemon/com.mycompany.mydaemon.plist* When i executed lauchctl without sudo , i got the same problem. I guess lauchctl requires root previlages to unload the daemon.Hence I'm using Authorization API to execute lauchctl instead of NSTask from Cocoa Application. I don't know why lauchctl is not working in combination with Authorization API. Please help me to solve this. Thanks in Advance, JanakiRam. On 3/23/08, Jens Alfke <[EMAIL PROTECTED]> wrote: > > > On 23 Mar '08, at 7:00 AM, JanakiRam wrote: > > >> I'm developing a cocoa application which needs to unload my > >> Launch > >> Daemon for one particular requirement. I've used Authorization > >> Services to > >> perform unload of Launch Daemon ( previlaged action ). But couldn't > >> succeed > >> in this. I'm getting the following error on executed my code. > >> > >> *Output :* > >> ** > >> *lauchctl : Error in unloading mydaemon* > > I don't know anything about the authorization API, but I've worked > with launchctl before (though only with per-user agents.) > > It looks like the problem isn't with your authorization code, but with > unloading the daemon. > > Have you tried running the same launchctl command-line from a shell, > with and without "sudo"? Do you get the same error? (If so, perhaps > there's more info in the output. Or check Console.app for output in > ASL or system.log). > > If it works OK from a shell, then try changing your code to run > something else, like maybe "rm" on a file owned by root, to make sure > the authorization part works correctly. > > Debugging is a science. If an experiment gives an inexplicable result, > start varying parameters one at a time and see what changes. > > —Jens > _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]