[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Logging off an X session closes all ssh -X connections started previously from outside X



On Fri 05 May 2023 at 09:13:04 (+0700), Max Nikulin wrote:
> On 05/05/2023 02:07, zithro wrote:
> > 2. using VNC or rdesktop, I then log on to X on the machine, do
> > some stuff, then hit "log off" from the desktop menu.
> > Immediately, ALL the previous SSH connections started in step 1
> > get closed, hence all the shells and the GUI apps (firefox, etc) !
> 
> Have you inspected journalctl output (as root) around the "log off" moment?
> 
> A wild guess is that it might be force close of systemd user session,
> however it should not happen. Try to compare systemd-cgls (user .slice
> and .scope), "loginctl list-users", "loginctl list-sessions" on each
> step.
> 
> Perhaps it may be related to user D-Bus sessions, however I would
> expect that ssh GUI app has its own bus created by dbus-launch.
> 
> Does it happen for newly created user with no customization?

Isn't it this issue?

https://news.ycombinator.com/item?id=19023885

I'm afraid I can't replicate the problem, though, as I don't have
a "log off" button or menu entry. That might suggest that the
problem is in something I don't run, like the DE or DM. (I assume
we're all using systemd.)

When I run multiple jobs through multiple ssh commands, I find
they're in different scopes, eg:

0::/user.slice/user-1000.slice/session-229.scope
0::/user.slice/user-1000.slice/session-230.scope

(To see the slice and scope, add cgroup to your ps command.
Add it as the last option, or its output might get truncated.)

When you've logged in to X, what slice/scopes do you see for X and
the processes you previously started? Are they all the same?

I think I've read that the way to get round this (or "go with the
flow") is to run the earlier processes as user services under systemd,
but I've not tried it.

Cheers,
David.


Reply to: