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 13:15:04 -0500
<installer-dev-bounces+xochitl_lunde=email@hidden>
wrote on 03/19/2010 11:21:45 AM:
> Yes, but it's fragile, and will probably break in future releases
of
> the OS. With each release of OS X, Apple makes it harder and
harder
> for a root process to operate in a user's context.
The problem that I see is with reinstallation/upgrade.
If you want to stop a daemon or agent that is installed and running
you use 'launchctl unload -w'. On my system the program often is
restarted automatically if I don't use the "-w" disable key.
Maybe this is a bug? Anyway, when I do an upgrade install,
I use the disable key to stop the daemon and launch agents entirely before
writing new files. If I just write the files and reboot, the disabled
key is still present and the new version won't load on the next boot. I
have to use launchctl to re-enable the agent, and so I have to operate
in at least the "on screen" user's context.
Since I cannot use launchctl to start the agent for
a user who is not "on screen", I don't allow the package to be
installed if there's FUS user logged in "off screen". The
enable/disable key is not set for that user because launchctl errors out
trying to 'su' to that user. For my package, I would anticipate a
problem if the user who reinstalls or upgrades is not the same user that
installed it originally (the requirement for problem is trickier than just
that, but this would be part of the equation).
I was using the Daemons and Agents Technical Note
2083 to figure out a lot of these kinds of things. Unfortunately
the documentation is lacking in its explanation of how to correctly start
an agent even though the description is present for Daemons. I did
fill out the feedback on that document saying that information is missing.
I don't know if it would help if more people would submit the same
feedback.
_______________________________________________
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