-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
systemd user session not always created #778
Comments
Something is strange with systemd interaction. I am noticing on Arch Linux that I can log in just fine, but when I log out the session is stuck in a "closing" state. From then on I cannot get a new session, but the desktop starts (at least things that don't need dbus or a usable systemd session). I think the problem is in session.c on how the sesman process forks. I noticed in the systemd-cgls command BOTH xrdp-sesman processes are in the session scope. In theory only the child should be in the session scope. This may actually be the problem, because if systemd kills the session on "logout" then xrdp-sesman terminates the parent process. I need to look into this more though. Do you see a full cleanup of processes on logout? |
No. As you can see in my first message, after closing the session, an xrdp-sesman process remains open but it's the service itself, so it cannot be closed. The systemd user session is kept in the closing state and all following rdp connections reuse the same session. |
If you check the |
It looks like the code there forks correctly on pstree, but in
Is that in fact what is happening now? The way I am following the code is as follows:
@jsorg71 or @metalefty it looks like you guys authored the code, can you comment on this? |
@geiseri Yes, you are right, that is how it works now. |
Yeah, I see |
I did confirm that moving lien 460 to line 469 does correctly behave, but I am not sure what that means for people not using systemd + pam. I tested and login/logout behaves correctly, and i could disconnect and reconnect again from Xorg. I need to test VNC and X11rdp yet, but it looks encouraging. |
This issue should be solved by #806. |
It looks fixed from my testing, @xhernandez can you please also confirm? |
@geiseri, @metalefty sorry for the late answer. I've been unable to test it earlier. It's working fine now. Thanks for your help. |
Apologies if I'm totally off-base (complete newbie here), but I found this old issue and I wonder if something similar is happening in the latest xrdp 0.9.14. I'm running it on Manjaro 18.0 XFCE Edition. When I reboot my server, connect to it via xrdp, and run |
Hi @usul0184 There are no changes in this area on our side that I'm aware of. You'll get a new session when you log in if both the following are true (I think):-
The first of these is quite important. For example, if you run
I don't have a copy of Manjaro to hand at the moment, but I've verified the above with v0.9.14 on Ubuntu 18.04. Hope that helps, |
Thanks! Actually, I think the problem is the same as #1677. |
I'm using version 0.9.2 on an Ubuntu Mate 16.04.2 LTS and apparently everything works fine. However I've seen that sometimes systemd is not creating the user session for the remote desktop user (this means that /run/user/ is not created).
Before login to the first login after a reboot:
After a connection with a RD user (m004786):
Note that there are two xrdp-sesman processes inside the session.
After loggin off:
Note that the session state is 'closing' and there remains one xrdp-sesman process inside the session (it corresponds to the service, so it will never stop unless the service is restarted).
Now I log in with another user (ge01350):
It has not created the session for the new user and its state is still 'closing', however the session manager is running with the new user:
If I close the session and restart the xrdp-sesman service, the session is finally closed. After that, if I log in again with ge01350, the /run/user/ directory is created normally.
If I log the two users simultaneously, they share the same systemd session.
The users come from an Active Directory using winbind and pam. An ssh session works fine, so I don't think this could be the reason.
I've been looking at the configuration but I don't see anything that could be related.
The text was updated successfully, but these errors were encountered: