FROM : JanakiRam
DATE : Sun Mar 23 18:17:30 2008
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_removed>> 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
>
DATE : Sun Mar 23 18:17:30 2008
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_removed>> 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
>
| Related mails | Author | Date |
|---|---|---|
| JanakiRam | Mar 22, 17:03 | |
| JanakiRam | Mar 23, 15:00 | |
| Jens Alfke | Mar 23, 16:52 | |
| JanakiRam | Mar 23, 18:17 | |
| Chris Hanson | Mar 24, 01:07 |






Cocoa mail archive

