Menu

#770 [lxdm] Broken second login with systemd 222

None
closed-invalid
dgod.osa
lxdm (80)
5
2015-08-01
2015-07-23
No

After I updated systemd to version 222, the second login is broken with LXDM, e.g. polkit unable to determine the user session. In the log files I can see the following message:

lxdm-session[541]: pam_systemd(lxdm:session): Cannot create session: Already occupied by a session

This message is added by this commit to systemd:
https://github.com/systemd/systemd/commit/b80120c4cba7d134b5437a58437a23fdf7ab2084

Downgrading to systemd 221 solves the problem.

Package versions:
- lxdm 0.5.1
- systemd 222
- xorg-server 1.17.2

Distribution: Arch Linux

Discussion

  • Balló György

    Balló György - 2015-07-23

    A workaround is to add 'KillUserProcesses=yes' to '/etc/systemd/logind.conf'.

     
  • dgod.osa

    dgod.osa - 2015-07-24

    DM can't kill session processes reliable, systemd can do it really well. Git version have try to do it now, it can work here.

     
  • dgod.osa

    dgod.osa - 2015-07-27
    • status: open --> closed-fixed
    • Group: -->
     
  • Balló György

    Balló György - 2015-07-29

    I confirm that the problem is solved. Thank you very much! :)

     
  • Balló György

    Balló György - 2015-07-29

    Unfortunately it doesn't work when I launch some applications with sudo. E.g. when I start 'sudo thunar', it launches some processes as root, which are left running after logout:

    /usr/bin/dbus-launch --autolaunch 0fb8e0bc7ac4493191e13326480d805c --
    /usr/bin/dbus-daemon --fork --print-pid 5 --print-address 7 --session
    /usr/lib/xfce4/xfconf/xfconfd
    /usr/lib/tumbler-1/tumblerd

     
  • dgod.osa

    dgod.osa - 2015-07-30
    • status: closed-fixed --> open
     
  • dgod.osa

    dgod.osa - 2015-07-30

    When I use gdm to run lxde desktop, the same thing happen, so it's may not bug of display manager.

    Here is my story:

    open lxterminal, now bash create an session and be the process leader, then run "sudo gnome-keyring-daemon", use htop can find the session id of gnome-keyring-daemon is the bash. Now close lxterminal, we will find bash exit, gnome-keyring-daemon should receive SIGHUP signal and exit process, but it does not.

    The real problem is some process left the control which an normal DM can't do something.

    In your sudo case, sudo -E thunar may help.

     
  • Balló György

    Balló György - 2015-07-30

    Using 'sudo -E thunar' solves the problem. Enabling reset=1 in lxdm.conf solves the problem too.

    I tested GDM, LightDM, SDDM, and all of them closes these root processes properly, and I'm able to relogin to a proper session.

    So restarting X probably closes these root processes, and this is the reason why other DMs work for me. Maybe enable it in lxdm.conf by default?

     
  • Balló György

    Balló György - 2015-07-30

    I found a problem with the recent changes:
    1. Switch user with 'lxdm -c USER_SWITCH'
    2. Select the already logged in user from the list.
    3. LXDM switches the VT to that user, but immediately logs out, and throws me back to the greeter.

    And another interesting thing (without the recent changes in LXDM): if I enable reset=1 in lxdm.conf and wait 20 seconds before login again, I get a proper session. If I login within 20 seconds, I get a broken session. GDM simply throws me back to the greeter if I try to relogin into LXDE within 20 seconds. With LightDM and SDDM, I'm able to relogin within 20 seconds.

     
  • Balló György

    Balló György - 2015-07-30

    But if openssh is installed, I'm not able to relogin even after 20 seconds with GDM and LXDM without the recent changes, because the ssh-agent remains running from the old session even if I restart X.

     
  • Balló György

    Balló György - 2015-07-30

    I reported this problem to GDM:
    https://bugzilla.gnome.org/show_bug.cgi?id=753076

    Apparently the 20 seconds wait is caused by the VBoxClient.

     
  • Balló György

    Balló György - 2015-07-30

    And I reported also to systemd:
    https://github.com/systemd/systemd/issues/792

     
  • dgod.osa

    dgod.osa - 2015-07-31

    some process are not related to X, like gnome-keyring-daemon, so set reset=1 default is not a real fix. As lxdm is designed for small and fast, I want to reuse the X server between two session.

     
  • Balló György

    Balló György - 2015-07-31

    Okay, then could you please fix the recent changes to not kill user processes on user switch as described above?

     
  • dgod.osa

    dgod.osa - 2015-07-31

    user switch problem fixed in last git commit

     
  • Balló György

    Balló György - 2015-07-31

    Thanks. Apparently it was a bug in logind:
    https://github.com/systemd/systemd/commit/10189fd6be0f547d75bc857860f3ecbbdbc447a6

    So killing user processes on logout is not so important now. Maybe make it configurable via lxdm.conf, and disable by default?

     
  • Balló György

    Balló György - 2015-07-31

    Or remove this code altogether? Killing user processes on logout breaks screen and similar programs. This is the reason why KillUserProcesses is not enabled in logind.conf by default:
    http://www.freedesktop.org/software/systemd/man/logind.conf.html#KillUserProcesses=

     
  • dgod.osa

    dgod.osa - 2015-07-31

    This code is useful, as some program like gnome-kerying-daemon often not exit with session.
    To workaround this, just unset XDG_SESSION_ID before run the program which don't want exit.

     
  • Balló György

    Balló György - 2015-07-31

    Okay.

     
  • dgod.osa

    dgod.osa - 2015-08-01
    • status: open --> closed-invalid
     

Log in to post a comment.