<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">James,</div><div class=""><br class=""></div><div class="">Some replies inline...</div><div class=""><br class=""></div>On 22 Jul, 2015, at 17:46, James Bucanek <<a href="mailto:subscriber@gloaming.com" class="">subscriber@gloaming.com</a>> wrote:<div><blockquote type="cite" class=""><div class="">
<meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type" class="">
<div bgcolor="#FFFFFF" text="#000000" class="">Damien,<br class="">
<br class="">
Thanks for the suggestion, and apologies for the tardy reply; I just got
buried under twenty other to-do items that were higher on the list.<br class="">
<br class="">
I tried removing the LimitLoadToSessionType entry from my agent's plist,
but it doesn't make any difference. When trying to install it as a
system-wide agent, the process still doesn't start.<br class=""></div></div></blockquote><div><br class=""></div><div>In launchd's lexicon, "system-wide agent" is a conflict of terminology. System-wide things are, by definition, daemons. Agents are things which run on a per-user basis (cf. launchd(8)). So the real question is about the desired lifecycle of your job. Do you want it to run when a user logs in and to go away when the user logs out? Or do you want it to be available regardless of any user being logged in?</div><br class=""><blockquote type="cite" class=""><div class=""><div bgcolor="#FFFFFF" text="#000000" class="">
My reading of LimitLoadToSessionType would lead me to believe that it's
applicable to my service, which *is* an agent. It runs as a regular
user, and the docs would indicate that this property is just a hint to
the load balancer on how to constrain its use of CPU/memory/IO. It
doesn't make sense that it would keep the process from starting in the
first place.<br class=""></div></div></blockquote><div><br class=""></div><div>Wow, no that's not at all what that key is for. Please file a bug explaining how the documentation misled you into that impression so we can make it clearer!</div><div><br class=""></div><div>Session types are basically collections of certain kinds of jobs. The "Aqua" session is all the jobs associated with a graphical login on the console. By default, if your job is an agent, it is loaded into the Aqua session. (That is, if no LimitLoadToSessionType key is present.)</div><div><br class=""></div><div>The Background session is a collection of jobs that can run on behalf of a user even if that user is not logged in at the graphical console. They might be doing things like performing Spotlight indexing on that user's home directory even when that user isn't logged in for example.</div><div><br class=""></div><div>So if you have a vanilla Terminal prompt and do a `launchctl load`, your plist will attempt to load in the Aqua session. If that service has LimitLoadToSessionType set to "Background", then that load will fail because it's attempting to load in the Aqua session and your service has expressed that it should only load in the Background session.</div><div>-damien</div><br class=""><blockquote type="cite" class=""><div class=""><div bgcolor="#FFFFFF" text="#000000" class="">
Anyway, I'm replying to Axel's message with a complete description of
what I'm trying to accomplish and exactly what's not working.<br class="">
<br class="">
James<br class="">
<span class="">
</span><br class="">
<blockquote style="border: 0px none;" cite="mid:055F4A57-2A9D-4C61-BF55-7825B9ADCDEF@apple.com" type="cite" class="">
<div style="margin:30px 25px 10px 25px;" class="__pbConvHr"><div style="display:table;width:100%;border-top:1px solid
#EDEEF0;padding-top:5px" class=""> <div style="display:table-cell;white-space:nowrap;vertical-align:middle;width:100%" class="">
        <a moz-do-not-send="true" href="mailto:dsorresso@apple.com" style="color:#737F92
!important;padding-right:6px;font-weight:bold;text-decoration:none
!important;" class="">Damien Sorresso</a></div> <div style="display:table-cell;white-space:nowrap;vertical-align:middle;" class="">
<font color="#9FA2A5" class=""><span style="padding-left:6px" class="">June 25, 2015 at
8:53 AM</span></font></div> </div></div>
<div style="color:#888888;margin-left:24px;margin-right:24px;" __pbrmquotes="true" class="__pbConvBody"><div class="">James,<br class=""><br class="">Your plist
probably has the LimitLoadToSessionType key set to Background, which
will prevent it from loading outside of a user's background session. So
when you do a regular `launchctl load` from a Terminal window (for
example), you're targeting the Aqua session, and launchd says no.
Similarly, if you try and load it into the system session (either by
running launchctl(1) under sudo(1) or by using the bootstrap subcommand
with a "system" target), launchd will also say no.<br class=""><br class="">If you remove
the LimitLoadToSession type key, you'll be able to load the job wherever
you'd like.<br class="">-damien<br class=""></div><div class=""><!----><br class="">
</div></div>
</blockquote>
<br class="">
</div>
</div></blockquote></div><br class=""></body></html>