Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Emulate LoginWindow behavior in shellspawn
LoginWindow is responsible for setting up the user session with launchd. For us, shellspawn serves the same purpose as LoginWindow, so we initialize the session there. This does require some additional dancing around with processes and sockets since launchd only expects a single process to register a session for a given user; this means that we couldn't just keep the old behavior with each shellspawn connection getting a new process and simply add-on launchd session initialization. In the new approach, shellspawn forks-off an instance for a user session and that instance has its own socket; this new instance is the one that receives shellspawn commands like the daemon previously did. The main socket (`/var/run/shellspawn.sock`) simply serves to start up new user sessions or connect to existing ones. I'm not quite sure I'm happy with the hacking around I did with shellspawn forks and sockets to get this to work; frankly, it introduces too much complexity into the shellspawn daemon. This is currently just a work-in-progress, so I might redesign that in a future commit. I'm currently leaning towards having a separate session manager daemon that the `darling` executable connects to and requests a session from; essentially, it would be what I added to shellspawn right now, but as its own separate daemon instead.
- Loading branch information