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: Xochitl Lunde <email@hidden>
- Date: Fri, 19 Mar 2010 09:46:59 -0500
> Hi,
>
> Launch the agent in all logged in user context.
> for userName in `/usr/bin/users`
> do
> su -l $userName
-c "launchctl load -S Aqua
> /Library/LaunchAgents/com.yourcmpny.plist"
> done
> But there are some disadvantages when you have
to support multiple
> logged in Users at the time of Install which I have discussed in the
> below link which you might want to take a look at.
> http://old.nabble.com/launch_msg():-Socket-is-not-connected-
> td23923855.html
>
> regards,
> ~Arjun
If this works for you I will be a little surprised.
It did not work for me on SnowLeopard. When starting the agent
for a user other than the one who is doing the installation, launchctl
throws an error at me. However, when using the GUI installer, the
environment variable $USER is set to the user who invoked the installer.
If you have to use sudo to install from the command line, then maybe
you can check for COMMAND_LINE_INSTALL=1 and not start the agent because
your $USER will be set to root. The InstallationCheck script will
get the SUDO_USER but the postinstall and preinstall won't get the SUDO_USER.
_______________________________________________
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