[launchd-dev] Starting Agents in specific GUI sessions

NuSkooler nuskooler at gmail.com
Thu Aug 15 16:07:27 PDT 2013


I am working on a large project that includes a kernel module (that talks
with the daemon), a centralized daemon (that runs as root/privileged) and
agents that interact with a user logged into a graphical session.

In the Windows world, when the daemon needs to show UI it simply creates a
new instance of a agent in the targeted session using CreateProcessAsUser()
and friends. On OS X however, this type of functionality does not seem to
be present.

I've found discussions around the "bsexec" option of launchctl but this
appears to no longer function in 10.7+. Are there new APIs/ways of doing
this? I know the session ID (derived from audit session information/etc.)
but do not see away to connect the dots.

I know about registering plist's in /Library/LaunchAgents in order to have
the agents start at login, but there are still times in which I need to
start/stop new instances of agents "on the fly" from the daemon space.

Thanks,

Bryan Ashby
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/launchd-dev/attachments/20130815/c619f0a0/attachment.html>


More information about the launchd-dev mailing list