Skip to content
  • Benjamin Berg's avatar
    main: Add systemd gnome-session monitoring code for leader · 7ba953ea
    Benjamin Berg authored
    We are in the situation that gnome-session-binary is the session leader
    process for the user. This process is managed via logind and is inside
    the session scope of the user. This process has an important role for
    the session lifetime management, but we cannot track or manage its state
    from the systemd user instance.
    
    This adds a simple protocol to allow us managing the state. The
    counterpart is in gnome-session-ctl.c.
    
    It works by creating a named fifo called gnome-session-leader-fifo in
    the users runtime directory. The session leader opens it for writing,
    the monitoring process opens it for reading.
    
    By closing the FD the monitor process can signal to the leader that the
    session has been shut down normally. By writing to the FD the leader can
    signal the monitoring process to initiate a clean shutdown of the
    session. If either process crashes or is killed, the FD is closed and
    the other side will also quit.
    7ba953ea