[launchd-dev] Cause of "Service cannot load in requested session"?

James Bucanek subscriber at gloaming.com
Fri Nov 13 18:16:05 PST 2015


> Gregory Neagle <mailto:gregneagle at mac.com>
> November 13, 2015 at 5:07 PM
> I think that is best you can hope for, unless you create a 
> LaunchDaemon that can find out what users you want to start background 
> sessions for.

I'll save you the trouble of reading the previous posts. What I really 
want is a "user daemon": a process that runs for a single user, all the 
time, whether the user is logged in or not. OS X really doesn't support 
this.

Many years ago, based on another suggestion, I implemented a "kicker" 
system daemon. This daemon has a list of UIDs that have my product 
installed.

So, at system startup, the "kicker" daemon executes once and performs a 
simple bootstrap name look up for each listed user. This has the 
side-effect of initializing the bootstrap for those specific users, 
which then causes all of the background agents for those users to start.

The end result is my "user daemon". At startup, an instance of each 
background agent is started for each user that has installed it.

At least, that was the plan...

James
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/launchd-dev/attachments/20151113/a58eaecf/attachment-0001.html>


More information about the launchd-dev mailing list