• 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: "sharad saxena" <email@hidden>
  • Date: Tue, 13 Feb 2007 20:37:19 -0800

Hi Finlay,
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:
So I was looking around for some fool proof cocoa API (if exists).
Unfortunately there is none I guess.

Thanks,
Sharad!

On 2/13/07, email@hidden <email@hidden> wrote:
Well, not all daemons are necessarily loaded into launchd. Anyway, I
suggest looking at the source to launchctl (available via Darwin) to
see how it does it.

  -- Finlay

Quoting sharad saxena <email@hidden>:

> Actually I want to get the list of all the jobs (services) loaded into
> launchd.
>
> On 2/12/07, Finlay Dobbie <email@hidden> wrote:
>>
>> On 12/02/07, sharad saxena <email@hidden> wrote:
>>> Hi ,
>>> Is there any cocoa API through which I can get the list of running
>> services?
>>
>> If you mean get a list of processe, then see
>> <http://developer.apple.com/qa/qa2001/qa1123.html>.
>>
>> -- Finlay
>>



_______________________________________________

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


  • Follow-Ups:
    • Re: Running daemon services.
      • From: "Finlay Dobbie" <email@hidden>
    • Re: Running daemon services.
      • From: Brian Smith <email@hidden>
References: 
 >Running daemon services. (From: "sharad saxena" <email@hidden>)
 >Re: Running daemon services. (From: "Finlay Dobbie" <email@hidden>)

  • Prev by Date: Re: Strange results with NSDateComponents vs NSCalendarDate
  • Next by Date: Re: Running daemon services.
  • Previous by thread: Re: Running daemon services.
  • Next by thread: Re: Running daemon services.
  • Index(es):
    • Date
    • Thread