Re: Launch agent runs as root immediately after install
Re: Launch agent runs as root immediately after install
- Subject: Re: Launch agent runs as root immediately after install
- From: Iceberg-Dev <email@hidden>
- Date: Fri, 19 Mar 2010 22:11:04 +0100
On Mar 19, 2010, at 10:58 AM, Chris Adamson wrote:
We're installing a LaunchAgent that we want to get up and running
immediately, so in a post-install script, we call "launchctl load /
Library/LaunchAgents/path.to.our.agent.plist".
I've noticed that this runs the agent as root, whereas the agent
will run as the user on subsequent logins.
Is there a way to get the agent running as the user who's
performing the install, rather than root?
su $USER -c "launchctl load -S Aqua /Library/LaunchAgents/..."
As for the discussion regarding whether a user is logged in or not,
if no users are logged in, you're probably performing the
installation not through Installer.app so checking the environment
var for a command line install should be enough.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Installer-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden