[launchd-dev] Stopping and unloading an agent from root-privileged application

James Bucanek subscriber at gloaming.com
Fri Jan 7 07:10:40 PST 2011


Quinn "The Eskimo!" <mailto:eskimo1 at apple.com> wrote (Friday, January 7, 2011 3:17 AM -0000):

> On 5 Jan 2011, at 17:30, James Bucanek wrote:
> 
> > Try this.
> > 
> > % sudo -u <username|#uid> launchctl stop my.agent
> > % sudo -u <username|#uid> launchctl unload /Library/LaunchAgents/my.agent.plist
> 
> Have you actually tried this?

I did try this out before I posted it, but admittedly only on 10.6.

> It /might/ work on 10.6, but I'm almost certain it won't work on 10.5 because
> launchctl looks up the launchd to talk to via its Mach bootstrap namespace,
> and sudo doesn't switch namespace.

Bummer. Apologies for the misdirection.

-- 
James Bucanek



More information about the launchd-dev mailing list