• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Unable to unload Launch Daemon using Cocoa Application.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Unable to unload Launch Daemon using Cocoa Application.


  • Subject: Re: Unable to unload Launch Daemon using Cocoa Application.
  • From: JanakiRam <email@hidden>
  • Date: Sun, 23 Mar 2008 22:47:30 +0530

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@hidden> 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 (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

References: 
 >Unable to unload Launch Daemon using Cocoa Application. (From: JanakiRam <email@hidden>)
 >Re: Unable to unload Launch Daemon using Cocoa Application. (From: JanakiRam <email@hidden>)
 >Re: Unable to unload Launch Daemon using Cocoa Application. (From: Jens Alfke <email@hidden>)

  • Prev by Date: [ANN] RegexKitLite
  • Next by Date: Re: Adding commandline batch mode to Cocoa app
  • Previous by thread: Re: Unable to unload Launch Daemon using Cocoa Application.
  • Next by thread: Re: Unable to unload Launch Daemon using Cocoa Application.
  • Index(es):
    • Date
    • Thread