Re: how to use the same udp port already loaded by launchd?
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