For a long time now, I have wanted to have proper integration in
Entrance display manager with logind/elogind. I have read various
freedesktop.org documents and others over the years. While these
questions may seem obvious, I am not asking from an uninformed
perspective.
1. What is the purpose of logind with regard to a display manager,
what is its role and utility?
2. What is the proper order of integration with logind using the C-
API, not using D-Bus?
3. Should a display manager even be connected to and integrated with
logind, and if so, what should it be doing, what data exchanged?
For #1, it seems logind provides means to set some variables such as
SEAT and VTNR, based on DISPLAY, but otherwise, I am unsure of what all
else it is doing and the benefit to integratoin.
For #2, it seems pam first, launches a logind session, but you need a
shell session for that, and I need to figure out how to start a
shell/logind, connect to logind session, and then fire the desktop
after in that same shell, which seems like some form of juggling.
Right now when the desktop is started, maybe incorrectly, logind is
fired off, shell --login, the env is correct, but no means to connect,
as we are trying to connect to logind using a PID that is not
associated to a session yet, and when it has the right PID, we are
waiting for that process to exit.
We do have a logind monitor, that may have to be its own PID and to be
able to connect to the desktop session PID, that has a active logind
session to connect to. All that seems a bit much, having another
process monitoring, and then what is the benefit of logind?
For #3, if logind via pam is setting SEAT and VTNR, it almost seems
like the DM and logind need not even talk to each other or no reason to
integrate with the API, which seems weird, but ok. Trying to understand
what data the DM needs or could use from logind, doesnt seem like
anything is sent, C-API seems read-only, with the rest via D-Bus.
I think that covers it, I go over way more in this issue, and welcome
to look at the code.
https://github.com/wltjr/entrance
entrance_logind_session_get() Failed to get session for PID 418: No
data available
https://github.com/wltjr/entrance/issues/63
entrance_logind_session_get() calling sd_pid_get_session()
Another contributed the logind integration, unfortunately, to correct,
I have had to remove parts. That almost brought me to the question.
Do I just remove it all; that would be unfortunate but maybe correct?
What is the point of logind integration with DM and what does each
gain, benefit, and/or need from the other?
Yes, this can be philosophical in nature, but I am speaking practically
on DM integration with logind. It seems most do not use the C-API, I
assume D-Bus, a direction I was thinking I needed to go before another
did the C-API with logind directly. I also realize, some DMs maybe
going away as they integrate with the desktop because of Wayland.
I am not new to any of this, but there is few documentation, its been
the same for years, I have read it, forgot some, never read other, and
looking at source code as well; far from an expert but not really a
novice either. In FOSS always more than one way to do stuff, and not
sure there is any real "correct" way, long as it works, secure, stable,
etc.
Thanks!
--
Sincerely, William L. Thomson Jr.