[launchd-dev] Starting launch agents
Quinn
eskimo1 at apple.com
Mon Oct 29 11:47:03 PDT 2007
At 14:58 -0400 29/10/07, Jeremy Reichman wrote:
>So now, with Leopard, LaunchAgents in /Library/LaunchAgents will run at
>login for each user, as the user [...], and without having to restart
>the computer between each user login session?
Yes. The only significant gotcha that I can think of relates to
installing and upgrading. Except in the simple case (where you have
one user logged in and your installer/upgrader is running in that
user's context), you run into problems with the install/upgrade
process. There's no built in way for you to tell all per-user
launchd's on the system that a new property list has been installed
(or that an old one has been upgraded). Thus, you can get into
situations where one user is running version X of your agent and
another is running version X+1. Or one user doesn't have the agent
installed and another does. There's no really good way around this
right now (although there are plenty of hackish ways).
Just for the record, we're tracking this as <rdar://problem/5476420>.
>as the user (by default)
The "(by default)" indicates some confusion about how agents work.
An agent is always launched by a per-user launchd, and that per-user
launchd is always running with its EUID and RUID set to that of the
user on whose behalf it's working. Thus, there's no "by default"
about it. An agent will always run as that user and there's no way
around that (other than by doing something silly like making your
agent setuid root). The UserName and GroupName properties in an
agent's plist are ignored (as they were on 10.4.x).
I've rolled all of this info into a new Technote 2083 "Daemons and
Agents" that scheduled to be published in the next couple of weeks.
Watch the skies! (actually, <http://developer.apple.com> :-)
S+E
--
Quinn "The Eskimo!" <http://www.apple.com/developer/>
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
More information about the launchd-dev
mailing list