Skip to content
Marcel Hollerbach edited this page Sep 17, 2017 · 5 revisions

Spawny

What is different to usual Loginmanagers?

A conservative loginmanager has a very basic workflow like:

  • Start a xserver
  • Start a greeter window that somehow prompts for a password
  • Start a session for the user and close the greeter window

However, this workflow has several downsides:

  1. A started session has not a fresh and clean xserver there has already been a other window messing with the xserver, and possiblity messing with settings

  2. Detecting the session has ended is quite complicated, and there is no real easy solution for monitoring this.

  3. You cannot run anything that is not a xserver session

  4. A developer of a window manager often just uses startx to start his session, and thus starts in a clean xserver. Where noone ever changed anything before

To change this spawny has its own design solutions in that regard

The spawny design

Spawny has a central daemon that listens for requests.

The daemon can start sessions that are part of 3 templates, tty, xserver and wayland.

A request can be for example the starting of a greeter, which will mean that the daemon will start a session and execute its own fallback cli greeter there or a other graphical one.

A login request from a greeter ends up in a started session. In the session itself a process will be started, which is different for each template, for x for example, simply startx is executed, for wayland just the path to the compositor is taken, and for the tty template a simple shell will be executed.

Detecting if a session is ended is quite easy here, each session has a session leader, spawny is placing there a process that just waits for the pid of the started process to terminate. Once that happens, it simply requests the daemon to start a greeter. So the user is never left with a unusable system.

Future ideas

Implement some sort of watchdog for graphical greeters and sessions, for the case we detect that a session hasnt sent any frame to the graphic device we can force the daemon to bring up a greeter, and focus this session.

Clone this wiki locally