Skip navigation.
 
mlRe: Unable to unload Launch Daemon using Cocoa Application.
FROM : Jens Alfke
DATE : Sun Mar 23 16:52:59 2008

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

Related mailsAuthorDate
mlUnable to unload Launch Daemon using Cocoa Application. JanakiRam Mar 22, 17:03
mlRe: Unable to unload Launch Daemon using Cocoa Application. JanakiRam Mar 23, 15:00
mlRe: Unable to unload Launch Daemon using Cocoa Application. Jens Alfke Mar 23, 16:52
mlRe: Unable to unload Launch Daemon using Cocoa Application. JanakiRam Mar 23, 18:17
mlRe: Unable to unload Launch Daemon using Cocoa Application. Chris Hanson Mar 24, 01:07