You are not logged in.

#1 2014-08-01 15:41:03

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,866

seat/session/user management (logind) - what is it good for ?

NOTE :

This thread is intended to get information about the beneifts of using logind for seat/session/user management over not using it.
If it shows signs of becoming an anti-systemd thread, i will personally request closing and/or deletion.

@ Moderators : I wasn't sure which board this thread should be in, but given i can't start threads in TGN, GNU/Linux Discussion appeared the most suitable.


---------------------------------------------------------

Some background info :

My main desktop boots with openrc instead of systemd.
That desktop is exclusively used by me, and has just 2 user accounts : root and my normal user account.
I boot to a console login and use startx / .xinitrc when i need a graphical environment.

After the recent update to xorg 1.16, starting X failed. This was because X determined it could run X  rootless, and tried to do that using logind.
Logind currently only works when the system is booted with systemd as PID 1, so logind is not running at all on my system.
I solved it by configuring X to always run with root rights, but it made me wonder what else i might be missing by not using logind.

I am aware of some things i miss :

- X can't run as user (Afaict it has run as root since X was designed 3 or 4 decades ago)

can't use reboot/shutdown/switch-to-other-user and such from within X
   I use acpid for that functionality and just logout of X sessions before i use those buttons.

   reboot/shutdown from within X are taken care of by polkit, not logind.
   Fast user switching from within X : this is taken care of by logind, but requires a DM that supports it.

- no automounting
  I intensely dislike any form of automounting and prefer mounting things manually or through fstab.
  All systems i use, regardless of OS / init system, are configured to automount as little as possible.

  not related to logind

What other functionality am i missing by not using logind ?

Last edited by Lone_Wolf (2014-08-02 12:03:35)


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#2 2014-08-01 15:50:54

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,739

Re: seat/session/user management (logind) - what is it good for ?

I am good with this thread being here.  I think this is a reasonable topic, but please, everyone, let's keep it on topic and not let it descend into a flaming disaster.  Thanks.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#3 2014-08-01 16:39:11

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,111
Website

Re: seat/session/user management (logind) - what is it good for ?

Lone_Wolf wrote:

- X can't run as user (Afaict it has run as root since X was designed 3 or 4 decades ago)

Xorg the server has run as root for quite some time, yes. That doesn't make it a good decision.

Lone_Wolf wrote:

- can't use reboot/shutdown/switch-to-other-user and such from within X
   I use acpid for that functionality and just logout of X sessions before i use those buttons.

You're confusing logind and policykit here, at least as far as reboot/shutdown goes. Fast user switching does use logind, but it requires support on the DM side.

Lone_Wolf wrote:

- no automounting
  I intensely dislike any form of automounting and prefer mounting things manually or through fstab.
  All systems i use, regardless of OS / init system, are configured to automount as little as possible.

logind has nothing to do with automounting. This is a feature of systemd itself via .automount units.

Logind provides:

1) Automatic TTY allocation and getty setup
2) Session cleanup on logout
3) Lingering sessions without interactive logins (systemd starts a user manager on bootup for lingering users which can then do whatever)
4) Support for dbus's "at_console" rules.
5) ACPI subscription (handling sleep/suspend, poweroff, reboot buttons)
6) Triggering an action on idle
7) Clearing IPC objects on full logout

There's probably other things I'm missing.

Offline

#4 2014-08-02 12:17:34

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,866

Re: seat/session/user management (logind) - what is it good for ?

falconindy wrote:
Lone_Wolf wrote:

- X can't run as user (Afaict it has run as root since X was designed 3 or 4 decades ago)

Xorg the server has run as root for quite some time, yes. That doesn't make it a good decision.

I agree, but have strong doubts whether the chosen method has more advantages then disadvantages.
Imo the consequences of this change should not be discussed in this thread, but i felt it needed to be mentioned.

falconindy wrote:
Lone_Wolf wrote:

- can't use reboot/shutdown/switch-to-other-user and such from within X
   I use acpid for that functionality and just logout of X sessions before i use those buttons.

You're confusing logind and policykit here, at least as far as reboot/shutdown goes. Fast user switching does use logind, but it requires support on the DM side.

I've looked up policykit and realised you are correct.
policykit CAN work with other mechanisms then logind, arch policykit is just configured in a way that makes it fail without logind.
This is however not logind's fault.

falconindy wrote:
Lone_Wolf wrote:

- no automounting
  I intensely dislike any form of automounting and prefer mounting things manually or through fstab.
  All systems i use, regardless of OS / init system, are configured to automount as little as possible.

logind has nothing to do with automounting. This is a feature of systemd itself via .automount units.

my mistake


I edited first post to reflect your comments.

falconindy wrote:

Logind provides:

1) Automatic TTY allocation and getty setup
2) Session cleanup on logout
3) Lingering sessions without interactive logins (systemd starts a user manager on bootup for lingering users which can then do whatever)
4) Support for dbus's "at_console" rules.
5) ACPI subscription (handling sleep/suspend, poweroff, reboot buttons)
6) Triggering an action on idle
7) Clearing IPC objects on full logout

There's probably other things I'm missing.

Are 'lingering users' those that are used to run a specific daemon/program , like ntp & mysql ?


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#5 2014-08-02 16:31:44

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,111
Website

Re: seat/session/user management (logind) - what is it good for ?

Lone_Wolf wrote:

I agree, but have strong doubts whether the chosen method has more advantages then disadvantages.

Seriously? Look no further than the long history of privilege escalation and other security bugs in setuid programs, and then reconsider whether or not there's more advantages than disadvantages. The only real disadvantage here is that the implementation has a dependency on a particular PID 1 (but consider that this might be alleviated in the future). Notice that wayland doesn't run as root, either.

Lone_Wolf wrote:

Are 'lingering users' those that are used to run a specific daemon/program , like ntp & mysql ?

No, those are handled by system accounts, and system services are used to start these services. Lingering is for real user accounts, in cases where you might want to start a session and run some jobs of your own (user services), without the need for being logged in interactively.

Offline

Board footer

Powered by FluxBB