• 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: Running daemon services.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Running daemon services.


  • Subject: Re: Running daemon services.
  • From: Brian Smith <email@hidden>
  • Date: Wed, 14 Feb 2007 13:07:32 +0800


On Feb 14, 2007, at 12:37 PM, sharad saxena wrote:

I am currently using launchctl functions only to get the list of
running services and to start stop the services, here's part of my
code -

NSString * arg1 = [NSString stringWithString:@"-c"];
NSString * arg2 = [NSString stringWithFormat:@"sudo launchctl list >
\"%@\"", service];
NSArray * args = [NSArray arrayWithObjects:arg1, arg2, nil];
/* [(withPrivileges) executeCommand:@"/bin/sh" withArguments:args]; */

The problem with the above code is when I use sudo to get the list of
running services then it *sometimes* hang and log shows its waiting
for password:

To run launchctl you should use the Authentication API instead of trying to use sudo. Look in the document for this which has links to sample code.


Brian
_______________________________________________

Cocoa-dev mailing list (email@hidden)

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: 
 >Running daemon services. (From: "sharad saxena" <email@hidden>)
 >Re: Running daemon services. (From: "Finlay Dobbie" <email@hidden>)
 >Re: Running daemon services. (From: "sharad saxena" <email@hidden>)

  • Prev by Date: Re: Running daemon services.
  • Next by Date: Printing Crash: Intel only
  • Previous by thread: Re: Running daemon services.
  • Next by thread: Re: Running daemon services.
  • Index(es):
    • Date
    • Thread