I'm not sure if xfce4-session is responsible for this, but if it is, it's not doing its job. It should be sending sigterm to all processes in the session, then waiting until they close. It definitely does not do that. Firefox, for example, says it was improperly closed every time. I am using slim at the moment.
So, this bug is still a bug. Over the years, I've come to appreciate its severity. Data loss *frequently* occurs due to this bug. I've used XFCE for years now and this is by far its biggest problem within my use case and I'm sure within many others'.
Sending a SIGTERM to most running applications including firefox closes it properly. That's all xfce would have to do to its child processes. Send SIGTERM to all processes, then wait until they all close. If after a user-configurable amount of time any don't close, it should not log off! It should say, "Logout failed. These programs are still running:" and give a list. Then it should return control to the user, who can close those programs manually (probably saving unsaved open documents) then try logging off again.
Also relevant, XFCE loses track of a whole bunch of processes and doesn't shut them down on logout. I got a list of them with the following method (done from the linux terminal):
0. ps aux >1
2. log off of XFCE
3. ps aux >2
4. compare with vimdiff
This is what I got:
eric 414 0.5 0.0 36920 3832 ? Ss 02:07 0:00 /usr/bin/dbus-daemon --session --address=systemd: --nofork --nopidfile --systemd-activation
eric 418 0.2 0.1 54660 5048 ? S 02:07 0:00 /usr/lib/xfce4/xfconf/xfconfd
eric 421 0.0 0.0 17628 252 ? Ss 02:07 0:00 /usr/bin/gpg-agent --sh --daemon --write-env-file /home/eric/.cache/gpg-agent-info
root 443 0.3 0.2 233876 9024 ? Ssl 02:07 0:00 /usr/lib/upower/upowerd
eric 454 0.0 0.2 275128 8128 ? Ssl 02:07 0:00 /usr/lib/gvfs/gvfsd
eric 466 0.0 0.1 406476 5548 ? Sl 02:07 0:00 /usr/lib/gvfs/gvfsd-fuse /run/user/1000/gvfs -f -o big_writes
eric 471 0.2 0.3 347732 12888 ? SNl 02:07 0:00 /usr/lib/tumbler-1/tumblerd
eric 472 0.0 0.1 335316 6576 ? Sl 02:07 0:00 /usr/lib/at-spi2-core/at-spi-bus-launcher
eric 489 0.0 0.0 36676 3488 ? S 02:07 0:00 /usr/bin/dbus-daemon --config-file=/etc/at-spi2/accessibility.conf --nofork --print-address 3
eric 494 0.0 0.1 216056 5168 ? Sl 02:07 0:00 /usr/lib/at-spi2-core/at-spi2-registryd --use-gnome-session
eric 501 0.1 0.2 309120 8436 ? Ssl 02:07 0:00 /usr/lib/gvfs/gvfs-udisks2-volume-monitor
root 504 0.7 0.1 365064 7200 ? Ssl 02:07 0:00 /usr/lib/udisks2/udisksd --no-debug
eric 521 0.0 0.1 351264 6396 ? Sl 02:07 0:00 /usr/lib/gvfs/gvfsd-trash --spawner :1.13 /org/gtk/gvfs/exec_spaw/0
eric 526 0.0 0.1 191728 5528 ? Ssl 02:07 0:00 /usr/lib/gvfs/gvfsd-metadata
The same thing happens when XFCE is invoked from slim and from many other DMs, I'm sure. So it looks like xfce4-session barely has any control over its child processes at all. Much more work needs to be done here.
I'm also battling with this bug for months.
This is one of the reasons why I don't think Linux is user-friendly at all.
I was sent here from: https://forum.xfce.org/viewtopic.php?id=9541
The link may be discussing a workaround, but I wouldn't call it a solution.
I'm really interesting in this bug to be solved. It will make XFCE perfect.
Is there any progress here ?
I'm using Xfce-4.12, xfce4-session-4.12.1 and slim.
I'm currently wrting an application that need to be launched at desktop start using xdg autostart spec, and thus, this application needs to be gracefully stopped by sending it SIGINT or SIGTERM when the user logs out.
Currently, if I start my app manually and logs out from Xfce, my app is simply killed. It causes some data loss and memory is not released. Is this xfce4-session or slim that should send this signal ? Do I miss something obvious ?
Is DBUS queries the way to go with >=xfce4-session 4.13.0 ?
Could https://git.xfce.org/xfce/xfce4-session/commit?id=9e7e160d6db39d39283bef6fafb7264f4a65d9e5 (from Bug #10172) influence here?
In my case, I can not reproduce the problem anymore with Xfce 4.14 and lightdm as display manager.
When I ask for reboot/shutdown, my application (using libSM) is receiving the DIE message from the session manager, then everything is cleaned and the application can exit gracefully as it should.
Can this report be closed then? Testing with SLiM (last release was 2013) would not make much sense anymore.
Closing this report.