Skip to content

Commit

Permalink
Emulate LoginWindow behavior in shellspawn
Browse files Browse the repository at this point in the history
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
facekapow committed Sep 25, 2023
1 parent aa9eddb commit ff66ed3
Show file tree
Hide file tree
Showing 3 changed files with 380 additions and 18 deletions.
Loading

0 comments on commit ff66ed3

Please sign in to comment.