Obsidian-StudiosInc / entrance

General purpose Display Manager built on the Enlightenment Foundation Libraries (EFL)
GNU General Public License v3.0
23 stars 10 forks source link

Entrance doesn't properly kill the apps, or should i say the session after exiting. #24

Closed SolarAquarion closed 6 years ago

wltjr commented 6 years ago

I assume your talking about logging into a session from Entrance. Rather than a session failing to end on log out. As in you log into Entrance, but then you experience further problems.

If that is the case, I think it is coming from the UI, entrance_client. If you enable autologin, it never starts the UI, entrance_client. Thus if that UI is causing the problem with other sessions or window managers. Then its a UI thing I can look into. How entrance_client is shutting down. If it happens with autologin as well. Then it is something else causing the issue.

Also are you using X or Xephyr? That may make a difference as well.

SolarAquarion commented 6 years ago

I'm using X, and i enabled auto login after i opened this session, let me log out and see. Currently Auto Login works great

SolarAquarion commented 6 years ago

I can't log out?

wltjr commented 6 years ago

Yeah autologin is like a one way action :face_with_head_bandage: I need to code something to start entrance_cilent on logout. Or re-autologin when you log out. Seems most using autologin would likely choose to shutdown vs logging out. It is a way to sorta replicate startx behavior. Which would also likely not restart X on logout etc.

It is something I need to address for sure. I ran into that myself right away...

wltjr commented 6 years ago

If your issue on logging in does not exist using autologin, then that confirms entrance_client is not releasing all resources or something on shutting down. X likely thinks entrance_client/EFL is still the WM even though that process stopped. I will look into that.

wltjr commented 6 years ago

I may have fixed this issue while addressing the logout issue with autologin in #25. If not I think I may have a clue where this is coming from with the X integration. Anyway see what the latest git does for you when you get a chance. Thanks!

SolarAquarion commented 6 years ago

It doesn't login? Here's my log

entrance.log

SolarAquarion commented 6 years ago
`Entrance prepare session
Loading X profile from /etc/profile
Loading X profile from /home/solaraquarion/.profile
Loading Xinit script /etc/X11/xinit/xinitrc.d/40-libcanberra-gtk-module.sh
Loading Xinit script /etc/X11/xinit/xinitrc.d/50-systemd-user.sh
Failed to connect to bus: No such file or directory
dbus-update-activation-environment: error: unable to connect to D-Bus: /usr/bin/dbus-launch terminated abnormally with the following error: Autolaunch error: X11 initialization failed.

Loading Xinit script /etc/X11/xinit/xinitrc.d/81overlay-scrollbar
Loading Xinit script /etc/X11/xinit/xinitrc.d/95dbus_update-activation-env
X session prepare complete, now launching wm /usr/bin/startkde
$DISPLAY is not set or cannot connect to the X server.

`

wltjr commented 6 years ago

Looks like I broke autologin. It hung for me as well there. I think I know why, just need to test that. For what ever reason it needed ecore_start_main_loop() in autologin, But that is really where it is supposed to stop. At least till entrance is stopped, then it proceeds and shuts stuff down. I was wondering about duplicate ones of those, or if that was even necessary.

I added a conditional for Xephyr, and seems that entire block is not needed and causing the issue your experiencing. I think once I remove that it should proceed with login. Which happens when you kill the process, signal 15 as seen in entrance.log. Its resuming after the signal, due to the ecore_start_main_loop().

Regular login should work. Which I think then this issue should no longer exist. I just need to fix autologin, remove that conditional entirely.

wltjr commented 6 years ago

Ok sorry about that, I removed that code in fa34245. It has always been there, and was not causing issue before. But with changing some things, seems that was causing a new issue. I should have known from testing in Xephyr, thus the conditional. But turns out it was bad all around.

That fixed autologin for me. I am still curious about your other issue with window managers fighting each other or something. You were reporting in the other issue #20 you closed in favor of this one. Either way let me know if you still have issues. Thanks!

SolarAquarion commented 6 years ago

apps weren't being killed when the WM is killed

entrance.log

wltjr commented 6 years ago

On logout or login?

If on login, per your latest log. Seems your manually logging in via the UI, entrance_client. I think that maybe holding onto X resources and preventing another window manager from doing its thing. If that is correct, using autologin should not have that issue for that given WM/Desktop.

If on logout, not sure I am clear as to the issue there. Are you saying apps are not being killed as the WM/Desktop session is ended. Not sure what could be causing that. Maybe the window manager is not sending signals to those to end. Or the session is not being terminated.

Entrance does not do anything really once you log in. It just waits for a PID to go away. Once that does it fires up the client again for another login. If logged out. If some signal is received, like system shutdown. It will shut itself down rather than restart the client. So if your logging out, and open applications are not closing. Not sure if I can do anything within Entrance there. Maybe restart the X server or tell it to terminate all clients.

SolarAquarion commented 6 years ago

Yes. I'm logging out and logging back in. Lightdm and etc, treats everything in that "process" as should be killed with the exiting of the session. Like why should vala-panel which is only enabled in openbox, show up in plasma? Why should Kmail or kpim or whatever, show up in entrance login?

wltjr commented 6 years ago

Yeah that makes sense. Let me see what I can do. Normally I think a WM handles that stuff. Anything I have open in Enlightenment closes when I log out. That stuff shows up when entrance_client starts is pretty funny :laughing: You don't want to be able to check your email and IM when logging into another desktop? That could almost be a feature. Never have to restart apps between logging out and back in.

The session stuff I believe in one shot in Entrance. I do not believe it creates a new X session, xauth, etc. Which may allow those clients to continue vs end. Or I need to have it make sure anything still connected to the server is stopped.

I will have to see if I can find a way to replicate. It makes much more sense now, so I can start to work on some fix. Thanks for the report. Sorry for the misunderstanding with the issue.

wltjr commented 6 years ago

@SolarAquarion when you get a chance please try out the latest in git. I switched from restarting just the client to restarting X server on log out. That also restarts the client. That is an initial step to fixing this issue. While I am restarting X, I am using the same env for X. That may cause an issue.

If you still have issues, I will need to fully reset the env for X, the X session, cookie, etc. I am re-using all that and just stopping X and restaring that. Which should terminate any X applications. But it may not end other stuff like daemons that were started for your session. Which may cause leakage between sessions. Like unlocking a keyring when user A is logged in. Then when user A logs out and B logs in, it still has the unlocked keyring from user A.

Anyway lets give this a go and see how it works for you. Then I can look to doing a full restart of the X server env and everything in time. Sorry for the delay on this. I had the idea right away per last attempts, and understanding the problem fully. Just lacked the time to test it out. But I am only using the same desktop, E. Which did not show problems before like you experienced. Thus I need your help to test out the fix for the issue you experience.

Thanks for reporting the issue, and testing potential fixes!

wltjr commented 6 years ago

I had to make a few more changes to fix the restarting X server in addition to entrance_client. If you have not tested it since my last comment, then its moot. Still may need to restart the session and the X server env. Just had to fix a few things I broke in the process of switching from just restarting client to restarting X server and entrance_client.

wltjr commented 6 years ago

@SolarAquarion that referenced commit should fully resolve this issue. I modified it to restart the session along with restarting X server. Please test it out when you get a chance to see if it resolves all issues you experienced on log out. I will let you close the issue. Thanks!