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

eveningnick eveningnick eveningnick at gmail.com
Tue Jan 4 11:57:36 PST 2011


Hello
How could i stop an agent from root-privileged application?

if i am working in a terminal, i can type:

% launchctl stop my.agent
% launchctl unload /Library/LaunchAgents/my.agent.plist

if i type

% su
% launchctl stop my.agent
% launchctl unload /Library/LaunchAgents/my.agent.plist

i get an error (because this "sudo launchctl" controlls "System
domain" launchd instance, not a "user session"'s one)

Is there a way to explicitly specify from a Root terminal that i want
to stop an agent that is loaded by launchd of the current user
session?
I tried to specify "sudo launchctl -S Aqua unload
/Library/LaunchAgents/my.agent.plist" but it says "Error unloading
plist".

I need that because i want, among a lot of other work, to stop and
unload an agent from a Privileged helper tool.

Is there any way to do that?
Thanks


More information about the launchd-dev mailing list