[launchd-dev] Stopping and uninstalling a LaunchDaemon job

Shawn Erickson shawnce at gmail.com
Wed Aug 27 08:24:34 PDT 2008


On Wed, Aug 27, 2008 at 8:15 AM, Quinn <eskimo1 at apple.com> wrote:
> At 8:08 -0700 27/8/08, Shawn Erickson wrote:
>>We have no issues using the rights we are granted to remove files
>>owned by root, etc. but we cannot use launchctl to stop the
>>LaunchDaemon because the uninstall task runs as the current user and
>>not as root (aka doesn't see the top level launchd instance).
>
> I'm confused.  To remove a file from /Library/LaunchDaemons you have
> to be running as root.  Why can't you sublaunch launchctl from that
> context?

Sorry the guy that has been playing around with this isn't in just yet
so I don't know the exact specifics but... It is my understanding he
is using authorization services to run a script and that script is
removing files, etc. just fine but launchctl running from under that
script cannot see the top level launchctl instance to remove the
launch daemon job. I believe he used id in the script as it logged the
current user.

I will pull up the code he is playing with, if I can find it, or wait
until he gets in...

-Shawn


More information about the launchd-dev mailing list