[launchd-dev] Problem with launchd starting user defined launchagent service in root user login

Thomas Clement tclementdev at gmail.com
Thu Dec 22 01:10:58 PST 2011


You should try:
launchctl -u root unload /System/Library/LaunchAgents/<plistfile>


On Dec 22, 2011, at 6:00 AM, Nandini Vijayashankar wrote:

> Hi,
> I want to know how does launchd start the user defined launchagents service when a "root" user logs in to the system.
> Iam using Mac 10.6
> I have a launchdaemon and launchagent present in /System/Library/LaunchDaemons and /System/Library/LaunchAgents.
> When I login with a non-root user, my launchagent service is started as that logged in user.
> I can unload this service using "launchctl unload /System/Library/LaunchAgents/<plistfile>"
> If I login as root user,my launchagent  service is started and working fine.But its not started as logged in user ie., root.
> If I try to unload through "launchctl unload /System/Library/LaunchAgents/<plistfile>" I get error:
> launchctl : Error unloading <id>
> This is because the service is not launched as root user.
> Above scenarios are working fine in Mac 10.5 as root and non-root user.
> When i see my launchagent service in Activity monitor, the parent process is the per-user launchd instance.
> The parent process of this launchd is system launchd with pid 1.
> I have tried to list the service using various commands:
> launchctl list
> launchctl bslist
> sudo launchctl list
> All these are not showing my launchagent service.Is there any special way, launchd launches launchagents service when a root user logs in Mac 10.6?
> How can i unload my launchagent service when the root user logs in?
> _______________________________________________
> launchd-dev mailing list
> launchd-dev at lists.macosforge.org
> http://lists.macosforge.org/mailman/listinfo.cgi/launchd-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/launchd-dev/attachments/20111222/e12d0818/attachment.html>

More information about the launchd-dev mailing list