• 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: how to use the same udp port already loaded by launchd?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: how to use the same udp port already loaded by launchd?


  • Subject: Re: how to use the same udp port already loaded by launchd?
  • From: Jens Alfke <email@hidden>
  • Date: Wed, 15 Jul 2009 11:39:31 -0700


On Jul 15, 2009, at 11:27 AM, Ian Mark Salvame wrote:

Is it proper to unload and load launchd agents programatically?
Are there any APIs to do that?

Unfortunately there aren't any APIs for this. What you have to do is run the 'launchctl' tool (using either NSTask, or fork+execv.) See "man launchctl" for details.


If the agent is being managed by the root instance of launchd (i.e. its service is defined in /Library/LaunchAgents) then you will need to run launchctl as root, using the authorization API. But if it's a per- user agent defined in ~/Library/LaunchAgents, you can just invoke launchtcl normally to control it.

By the way, what exactly are you trying to do? I can't think of a good reason why you'd need to do this; it's possible you're headed down the wrong path.

—Jens _______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: how to use the same udp port already loaded by launchd?
      • From: Ian Mark Salvame <email@hidden>
References: 
 >how to use the same udp port already loaded by launchd? (From: Ian Mark Salvame <email@hidden>)
 >Re: how to use the same udp port already loaded by launchd? (From: Eli Bach <email@hidden>)
 >Re: how to use the same udp port already loaded by launchd? (From: Ian Mark Salvame <email@hidden>)

  • Prev by Date: Re: how to use the same udp port already loaded by launchd?
  • Next by Date: Re: how to use the same udp port already loaded by launchd?
  • Previous by thread: Re: how to use the same udp port already loaded by launchd?
  • Next by thread: Re: how to use the same udp port already loaded by launchd?
  • Index(es):
    • Date
    • Thread