Starting Agents in specific GUI sessions
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
Hello, Bryan. Processes launched by agents can spawn other processes, and these other processes may be GUI processes. Processes may also install and load additional launch agents. Non-GUI processes (processes without a connection to the window server) can show rudimentary alerts using the CFUserNotification API. Maybe we need to know a little more about what you're trying to do.
participants (2)
-
Jerry Krinock
-
NuSkooler