Open miceno opened 2 months ago
At present, when a VNC session is closed, all processes belonging to that user are also closed, so if you have logged in via SSH as the same user, then that SSH session will also be terminated.
This was a recent change, and there are arguments on both sides as to whether this is the "right" thing to do, but it is intentional and not a bug.
...there are arguments on both sides as to whether this is the "right" thing to do...
Please name an argument for this new behaviour, as I'm struggling to think of any. Why would you want a footgun like this? Does any other remote control software do this???
As with everything else in this day and age, "security". There is an argument that when a user logs out, that should not leave any of the processes started by that user running, as otherwise the user is not really "logged out" and their account is still active and could potentially be accessed.
For example - if, while logged in, you start a process or application which gives access to your camera - would you really want that to continue running invisibly once you had logged out?
I am not going to get into a debate about whether this is right or wrong (so please don't start one...) but the behaviour is, as far as I am aware, deliberate.
@spl237 Thank you for the details!
This is not the place then to argue about it, so are you aware where that discussion is happenning about what to do when logging out from the GUI?
At present, when a VNC session is closed, all processes belonging to that user are also closed, so if you have logged in via SSH as the same user, then that SSH session will also be terminated.
So it is the code in wayvnc
that is closing the session? Or is it a wrapper around it? Would you please point me to the code that is making this happen? I can then try to patch it in my setup.
Does any other remote control software do this???
Reminds me of GNU screen gets killed on logout - https://bugzilla.redhat.com/show_bug.cgi?id=1480460, which leads to https://lists.freedesktop.org/archives/systemd-devel/2016-May/036583.html. Perhaps it's something similar and can be controlled by configuring systemd-logind
?
This is unrelated to WayVNC, the same behaviour exists if you just logout of Wayfire from the desktop while you have an ssh connection.
Unsure why this is the case, the SSH client shouldn't actually be a child of the Wayfire process...
See above - it is because it is a process owned by the same user, so it gets terminated when the desktop closes, since this change - https://github.com/raspberrypi-ui/pishutdown/commit/113553f878ccac367dab48af657da8d20f0a605f
If you close the desktop by just killing the wayfire process manually, the SSH process will continue running.
How to reproduce
ssh
session from your laptop in the same LAN as the RPi (using Wifi).screen
window on the SSH session and detach it.Expected behaviour
After logout of Wayland desktop, the SSH session is not closed and I can attach again to the detached
screen
session.Actual behaviour
The SSH session is closed when closing the Wayland session.
Upon reopening a new
ssh
to the RPi, and runningscreen
, the previous detached session is dead:There is no way to recover the detached
screen
session, and the only way is by wiping the dead session.Additional details
journalctl
show the SSH daemon is killed during logout.