VNC server boots ok, and I can work fine… provided I keep the ssh terminal (from which I launched vncserver) running. If I close the terminal, lxde dies … in fact the vncserver session does not die… maybe even lxde, as it keeps the wall paper, but all the icons and the windows dissapear from the desktop.
By default logind terminates all processes that are part of user session.
and how to change it?
See description of KillUserProcesses= in man logind.conf. If 15.1 already supports it, there are also KillOnlyUsers=, KillExcludeUsers=.
You may consider writing user service so vncserver is started outside of normal interactive session and enable lingering for your user. This would also ensure vncserver remains after session is terminated.
It was not the way it worked before, I used to open a ssh session, run “vncserver -geometry 1920x1080 :1” close the ssh session, and the vnc server was persistent.
This way I have used in several machines, it always worked.
I have been trying with scree and tmux both of them may keep the process running when you close the terminal.
But both of them fail to do so in this case.
In fact I have seen that vnc is not killed.
This are the process running when lxde is working in the vncserver
Am a bit confused by your description…
Some assumptions…
The 15.1 you’re referring to is likely the remote machine you’re connecting to, not the client.
Aside from your unorthodox way of connecting,
You seem to be describing 3 different layers in your connection…
The SSH session
The User session
The VNC server session running on the remote machine.
Although it would generally be good practice to shutdown each of the 3 layers in the reverse order created,
I think you are asking why it might be that if the SSH session is suddenly terminated which may or may not break the User session logged into the VNC server session running on the remote machine, why the VNC server session continues to run (or not? - I’m confused. Or, is this where your confusion actually is, assuming that the User session is essential to the running VNC server session which is a matter of configuration so is not necessarily so).
Keep in mind that with LEAP 15.0 and continuing through 15.1, VNC server has undergone enormous architectural and configuration changes which are documented everywhere both in the official TigerVNC documentation and in our LEAP documentation. So far, AFAIK legacy setup methods can be forced, but has to be configured manually… A new install is likely very different and if you upgraded instead of installing new may even be different in unexpected ways. Wayland now supports remote sessions, so it now becomes important to know whether you are running Wayland or Xorg X server on your remote machine. “One Time” vs Persistent VNC sessions are now configured differently than before and the defaults may have changed which could possibly explain a different behavior.
I’m testing on a different computer recently upgraded too to opensuse 15.1 from 42.3.
I’m (and was) using x2go in this computer instead of vncserver. X2go makes persistent virtual graphics sessions, you launch one session, close x2go client and then the session remain so when you connect again the session is there same as last time.
There I have the same issue with lxde sessions through x2go: I open a session, open some windows (for instance firefox, lxterm, etc.), close x2go client, connect again… and the sessions is a new one, the last was not saved.
But if I connect with x2go with a kde session then the session IS persistent.
So it is a lxde issue (in opensuse 15.1, previously it worked fine).
Aside from your unorthodox way of connecting,
You seem to be describing 3 different layers in your connection…
The SSH session
The User session
The VNC server session running on the remote machine.
Although it would generally be good practice to shutdown each of the 3 layers in the reverse order created,
I think you are asking why it might be that if the SSH session is suddenly terminated which may or may not break the User session logged into the VNC server session running on the remote machine, why the VNC server session continues to run (or not? - I’m confused. Or, is this where your confusion actually is, assuming that the User session is essential to the running VNC server session which is a matter of configuration so is not necessarily so).
I want the session to be persistent. The process
-I open a terminal (konsole in kde, putty in windows…)
-I access the server through ssh
-I launch the vncserver
-I close the terminal
In Opensuse 42.3 the vncserver remain persistent.
Now… in fact vncserver remains, but icons, windows, taskbar… all dissapear in the vnc session. The only thing wich remains is the wallpaper.
-I close the ssh
Keep in mind that with LEAP 15.0 and continuing through 15.1, VNC server has undergone enormous architectural and configuration changes which are documented everywhere both in the official TigerVNC documentation and in our LEAP documentation. So far, AFAIK legacy setup methods can be forced, but has to be configured manually… A new install is likely very different and if you upgraded instead of installing new may even be different in unexpected ways. Wayland now supports remote sessions, so it now becomes important to know whether you are running Wayland or Xorg X server on your remote machine. “One Time” vs Persistent VNC sessions are now configured differently than before and the defaults may have changed which could possibly explain a different behavior.
TSU
I have upgraded it from 42.3 with the offline method.
I stay corrected, this is apparently still disabled by default in Leap 15.1.
These cannot be all processes. At least processes related to ssh and systemd are missing. When you show computer output always include command and full output including next shell prompt - only this way can information be correctly interpreted.
Can you show output of “loginctl --no-pager --full user-status fperal” after you have started vncserver as well as upload “journalctl -b” after you have closed ssh session to http://susepaste.org/.
OK, I tested it and as I suspected - LXDE session starts a lot of processes under systemd user instance (and this includes D-Bus). When you exit ssh session, user systemd instance is also stopped which terminates a lot - including D-Bus, which likely brings down most remaining processes.
To preserve them you need to enable lingering for systemd user instance:
In the previous message I just posted the process which appeared after xvnc and then the precess remaining once I closed the ssh session. As you said closing ssh sessions brings down most of them.
To preserve them you need to enable lingering for systemd user instance:
loginctl enable-linger fperal
yes, it worked.
Two questions I’m not sure about:
I have to include this in a boot scriipt or it is a persistent change?
Is this the same as using KillExcludeUsers=fperal in /etc/systemd/logind.conf?
My logind.conf is this
root@tutatis:/home/fperal> cat /etc/systemd/logind.conf
# This file is part of systemd.
#
# systemd is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version.
#
# Entries in this file show the compile time defaults.
# You can change settings by editing this file.
# Defaults can be restored by simply deleting this file.
#
# See logind.conf(5) for details.
[Login]
#NAutoVTs=6
#ReserveVT=6
#KillUserProcesses=no
#KillOnlyUsers=
#KillExcludeUsers=root
#InhibitDelayMaxSec=5
#HandlePowerKey=poweroff
#HandleSuspendKey=suspend
#HandleHibernateKey=hibernate
#HandleLidSwitch=suspend
#HandleLidSwitchDocked=ignore
#PowerKeyIgnoreInhibited=no
#SuspendKeyIgnoreInhibited=no
#HibernateKeyIgnoreInhibited=no
#LidSwitchIgnoreInhibited=yes
#HoldoffTimeoutSec=30s
#IdleAction=ignore
#IdleActionSec=30min
#RuntimeDirectorySize=10%
#RemoveIPC=no
#InhibitorsMax=8192
#SessionsMax=8192
#UserTasksMax=33%
root@tutatis:/home/fperal>
Everything by default, so willl not be KillUserProcess=no?