Page 1 of 1

Losing session when screen is locked

Posted: Sun Apr 14, 2019 5:04 pm
by sanskk
Hello!

I'm losing my session quite reliably when I lock my screen manuallyor it gets locked automatically and isn't activated again for several minutes.

At first I thought it was a problem with suspend, but it happens when the computer didn't even enter it, too. The desktop looks as if I rebooted my system, but a lot of tasks are still running, without me being able to access them. Also, this is increasing the used RAM every time it happens.

It seems to happen when the session is locked for more than, say, 5 minutes, but I haven't been able to narrow it down to the point. Most of the time I have to give my credentials twice when reaccessing the locked session, and almost all the time it creates a new one, but even when it doesn't, I have to give them twice.

The first screenshot was created after rebooting the system, the second after a reaccessing a session which was locked for 50 minutes. The rsync processes started 3 hours earlier and are still there, but I don't know if they are working. How is it possible that it is already the 13th session of the user, when the computer was active all the time since that occurrence of the problem?

What can I do?

System info:

Code: Select all

System:    Host: Host Kernel: 4.19.0-1-amd64 x86_64 bits: 64 compiler: gcc v: 6.3.0 
           Desktop: Xfce 4.12.3 Distro: MX-18.2_x64 Continuum Dec 20  2018 
           base: Debian GNU/Linux 9 (stretch) 
Machine:   Type: Laptop System: LENOVO product: 20BHS0L000 v: ThinkPad W540 serial: <filter> 
           Mobo: LENOVO model: 20BHS0L000 serial: <filter> UEFI [Legacy]: LENOVO 
           v: GNET89WW (2.37 ) date: 11/14/2018 
Battery:   ID-1: BAT0 charge: 86.3 Wh condition: 88.3/99.5 Wh (89%) model: SANYO 45N1779 
           status: Unknown 
           Device-1: hid-34:88:5d:72:60:40-battery model: Logitech K810 charge: N/A 
           status: Discharging 
CPU:       Topology: Quad Core model: Intel Core i7-4800MQ bits: 64 type: MT MCP arch: Haswell 
           rev: 3 L2 cache: 6144 KiB 
           flags: lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx bogomips: 43101 
           Speed: 2309 MHz min/max: 800/3700 MHz Core speeds (MHz): 1: 1598 2: 1611 3: 1508 
           4: 1518 5: 1603 6: 1607 7: 1595 8: 1599 
Graphics:  Device-1: Intel 4th Gen Core Processor Integrated Graphics vendor: Lenovo 
           driver: i915 v: kernel bus ID: 00:02.0 
           Device-2: NVIDIA GK107GLM [Quadro K1100M] vendor: Lenovo driver: nouveau v: kernel 
           bus ID: 01:00.0 
           Display: x11 server: X.Org 1.19.2 driver: modesetting,nouveau unloaded: fbdev,vesa 
           resolution: 1920x1200~60Hz, 1920x1080~50Hz 
           OpenGL: renderer: Mesa DRI Intel Haswell Mobile v: 4.5 Mesa 18.2.6 direct render: Yes 
Audio:     Device-1: Intel Xeon E3-1200 v3/4th Gen Core Processor HD Audio vendor: Lenovo 
           driver: snd_hda_intel v: kernel bus ID: 00:03.0 
           Device-2: Intel 8 Series/C220 Series High Definition Audio vendor: Lenovo 
           driver: snd_hda_intel v: kernel bus ID: 00:1b.0 
           Sound Server: ALSA v: k4.19.0-1-amd64 
Network:   Device-1: Intel Ethernet I217-LM vendor: Lenovo driver: e1000e v: 3.2.6-k port: 5080 
           bus ID: 00:19.0 
           IF: eth0 state: up speed: 1000 Mbps duplex: full mac: <filter> 
           Device-2: Intel Wireless 7260 driver: iwlwifi v: kernel port: 4000 bus ID: 03:00.0 
           IF: wlan0 state: down mac: <filter> 
           IF-ID-1: tun0 state: unknown speed: 10 Mbps duplex: full mac: N/A 
           IF-ID-2: tun1 state: unknown speed: 10 Mbps duplex: full mac: N/A 
Drives:    Local Storage: total: 7.51 TiB used: 5.27 TiB (70.1%) 
           ID-1: /dev/sda vendor: Samsung model: MZ7TE256HMHP-000L7 size: 238.47 GiB 
           ID-2: /dev/sdb type: USB vendor: Intenso model: External USB 3.0 size: 3.64 TiB 
           ID-3: /dev/sdc type: USB vendor: Intenso model: External USB 3.0 size: 3.64 TiB 
Partition: ID-1: / size: 97.93 GiB used: 6.82 GiB (7.0%) fs: ext4 dev: /dev/dm-0 
           ID-2: /boot size: 476.2 MiB used: 79.4 MiB (16.7%) fs: ext4 dev: /dev/sda1 
           ID-3: /home size: 103.82 GiB used: 31.41 GiB (30.3%) fs: ext4 dev: /dev/dm-1 
           ID-4: swap-1 size: 32.00 GiB used: 160.5 MiB (0.5%) fs: swap dev: /dev/dm-2 
Sensors:   System Temperatures: cpu: 65.0 C mobo: N/A 
           Fan Speeds (RPM): cpu: 2390 
Repos:     Active apt repos in: /etc/apt/sources.list.d/antix.list 
           1: deb https://mirror.eu.oneandone.net/linux/distributions/mx/packages/antix/stretch/ stretch main
           Active apt repos in: /etc/apt/sources.list.d/debian-stable-updates.list 
           1: deb http://ftp.de.debian.org/debian/ stretch-updates non-free contrib main
           Active apt repos in: /etc/apt/sources.list.d/debian.list 
           1: deb http://ftp.de.debian.org/debian/ stretch non-free contrib main
           2: deb http://security.debian.org/ stretch/updates non-free contrib main
           3: deb http://deb.debian.org/debian/ stretch-backports main
           Active apt repos in: /etc/apt/sources.list.d/mx.list 
           1: deb https://mirror.eu.oneandone.net/linux/distributions/mx/packages/mx/repo/ stretch non-free main
           Active apt repos in: /etc/apt/sources.list.d/perfect-privacy-vpn.list 
           1: deb https://www.perfect-privacy.com/repos/linux/debian/ perfect-privacy-vpn stable
           Active apt repos in: /etc/apt/sources.list.d/teamviewer.list 
           1: deb http://linux.teamviewer.com/deb/ stable main
           No active apt repos in: /etc/apt/sources.list.d/various.list 
Info:      Processes: 348 Uptime: 9h 20m Memory: 31.04 GiB used: 4.65 GiB (15.0%) Init: SysVinit 
           runlevel: 5 Compilers: gcc: 6.3.0 Shell: bash v: 4.4.12 inxi: 3.0.33 

Re: Losing session when screen is locked

Posted: Sun Apr 14, 2019 8:18 pm
by fehlix
I cannot see anything on that screenshots just some white blank.
Anyway. Would uninstalling xscreensaver change the situation, and potentially also clearing any saved sessions. Not sure whether the newer version xfce4-settings from mx test-repo would help.
If you have teamviewer as daemon running, I would probably also try to disable the teamviewer daemon, as I remember I had quite some issue with having it permanently running. I'm using teamviewer not very often, so it make no sense to me to have it permanently running, when it also makes some issue when shutting down or wake up.
:puppy:

Re: Losing session when screen is locked

Posted: Mon Apr 15, 2019 8:04 am
by sanskk
I updated the first post, the images should be there now.

I tried several settings with xscreensaver installed and removed, several power settings, but the behavior doesn't change. I cleared the saved sessions already, it didn't help either.

I killed the teamviewer daemon now. I'll see, if this could be the culprit.

In the attached pictures you can see, that there are several sessions created for the user in the time the screen is locked. I already changed the login behavior to let me choose which session I want to continue, but there is only one at any given time. I suspect whatever is creating these sessions is what is buggering me.

The newer version xfce4-settings will have to wait until I tested the possible change due to killing teamviewer.

UPDATE:
Throughout the day my computer was locked three times, twice because I locked it and once because I left it unattended, but I reaccessed it after 5 minutes maximum, everything was fine.
Now I came back from a full hour of absence after a manually locked session, and even now everything worked fine.

If it works tomorrow morning, too, I guess teamviewer's daemon is in fact the culprit.

Re: Losing session when screen is locked

Posted: Tue Apr 16, 2019 5:05 am
by sanskk
After another night of a manually locked session everything is till working, so it was in fact teamviewer's daemon. Thank you very much!

Re: Losing session when screen is locked

Posted: Tue Apr 16, 2019 4:24 pm
by sanskk
Well, it happened again, after a few hours of a manually locked session. I don't know what could have caused this massive amount of new sessions.

Re: Losing session when screen is locked

Posted: Tue Apr 16, 2019 4:39 pm
by fehlix
sanskk wrote: Tue Apr 16, 2019 4:24 pm Well, it happened again, after a few hours of a manually locked session. I don't know what could have caused these massive amount of new sessions.
And teamviewer is not up again?

Re: Losing session when screen is locked

Posted: Tue Apr 16, 2019 6:03 pm
by sanskk
No, it wasn't running again.
The only thing I changed was I started caffeine with it's system tray icon, but that was yesterday, and it worked at first.

After another locked screen for 10, maybe 15 minutes and another lost session I just rebooted, killed the teamviewer daemon and will see what will happen.

I activated the power manager system configuration for suspending after 30 minutes of inactivity, but the computer was neither inactive for 30 minutes nor suspended.

Re: Losing session when screen is locked

Posted: Tue Apr 16, 2019 6:34 pm
by fehlix
sanskk wrote: Tue Apr 16, 2019 6:03 pm After another locked screen for 10, maybe 15 minutes and another lost session I just rebooted, killed the teamviewer daemon and will see what will happen.
I would probably try to get rid of xscreensaver and use light-locker. That's the default in MX18.2 anyway.
To avoid any teamviewer interventions I would probably also just disable teamviewerd e.g. with "sudo sysv-rc-conf"

Re: Losing session when screen is locked

Posted: Tue Apr 16, 2019 7:02 pm
by sanskk
sanskk wrote: Mon Apr 15, 2019 8:04 am I tried several settings with xscreensaver installed and removed, several power settings, but the behavior doesn't change. I cleared the saved sessions already, it didn't help either.
Right now Xscreensaver isn't even installed, but light-locker is, configuration in the attached image.

When I type light-locker in terminal, it gives the following prompt:

Code: Select all

** (light-locker:12441): WARNING **: 01:00:31.861: screensaver already running in this session
Also, I disabled all the teamviewer services in the sysv-rc-conf, 1 was off, but 2 to 5 was still activated. What does that even mean?

Re: Losing session when screen is locked

Posted: Tue Apr 16, 2019 7:38 pm
by fehlix
sanskk wrote: Tue Apr 16, 2019 7:02 pm Right now Xscreensaver isn't even installed, but light-locker is, configuration in the attached image.

When I type light-locker in terminal, it gives the following prompt:

Code: Select all

** (light-locker:12441): WARNING **: 01:00:31.861: screensaver already running in this session
Also, I disabled all the teamviewer services in the sysv-rc-conf, 1 was off, but 2 to 5 was still activated. What does that even mean?
you call light-locker's screen lock via "xflock4", which is also bound to "Ctrl-Alt-Delete" key-combo .
runlevel's 2 to 5 are the right one's to disable or re-enable. Those are notation of different "states" the system boot's into,
e.g. with or whithout X-UI or single console only.
Alternatively you can disable termviewer with "teamviewer daemon disable"
see "teamviewer help"
not sure about the screensaver setting within power manager. Probably for now just disable this too.

Re: Losing session when screen is locked

Posted: Tue Apr 16, 2019 8:17 pm
by sanskk
xflock4 is what I use to lock my screen manually.
I disabled light locker for now. We'll see tomorrow.

Re: Losing session when screen is locked

Posted: Tue Apr 16, 2019 8:39 pm
by fehlix
sanskk wrote: Tue Apr 16, 2019 8:17 pm xflock4 is what I use to lock my screen manually.
I disabled light locker for now. We'll see tomorrow.
xflock4 is just a xfce4-wrapper script and calls light-locker. The command issued to lock is

Code: Select all

light-locker-command --lock

Re: Losing session when screen is locked

Posted: Tue Apr 16, 2019 8:48 pm
by sanskk
My bad, I meant I disabled the automatical lock of the session by Light Locker, see attached image.

Re: Losing session when screen is locked

Posted: Wed Apr 17, 2019 9:40 am
by sanskk
12 hours in suspend – no new session.
Another hour in manually locked session – no new session.

I hope this time it'll stay this way. Thank you again for your help.

Re: Losing session when screen is locked

Posted: Fri Apr 19, 2019 2:54 pm
by sanskk
It is working flawlessly now. Thank you very much!

Re: Losing session when screen is locked

Posted: Sun Apr 21, 2019 9:56 am
by oops
fehlix wrote: Sun Apr 14, 2019 8:18 pm I cannot see anything on that screenshots just some white blank.
Anyway. Would uninstalling xscreensaver change the situation, and potentially also clearing any saved sessions. Not sure whether the newer version xfce4-settings from mx test-repo would help.
If you have teamviewer as daemon running, I would probably also try to disable the teamviewer daemon, as I remember I had quite some issue with having it permanently running. I'm using teamviewer not very often, so it make no sense to me to have it permanently running, when it also makes some issue when shutting down or wake up.
:puppy:
FI: I'm using teamviewer not very often too, so:

Code: Select all

sudo teamviewer --daemon disable # disable teamviewer service
Manually:
sudo /opt/teamviewer/tv_bin/teamviewerd -d # to enable teamviewer service
...
Then to launch:
/opt/teamviewer/tv_bin/script/teamviewer

sudo killall teamviewerd # to kill
 

Re: Losing session when screen is locked

Posted: Sun Apr 21, 2019 10:46 am
by fehlix
oops wrote: Sun Apr 21, 2019 9:56 am FI: I'm using teamviewer not very often too, so:
If AnyDesk cannot be used I use the following teamviewer desktop starter,
while having disabled to start teamviewerd as service during boot:

Code: Select all

[Desktop Entry]
Version=1.0
Encoding=UTF-8
Type=Application
Categories=Network;

Name=TeamViewer 12
#Name=TV12_initD
Comment=Remote Support with Teamviewer
#Exec=/opt/teamviewer/tv_bin/script/teamviewer
Exec=sh -c '( sudo /etc/init.d/teamviewerd status | grep -q running ) || sudo /etc/init.d/teamviewerd start ; /opt/teamviewer/tv_bin/script/teamviewer ; sudo /etc/init.d/teamviewerd stop'

# This icon might be overridden by other icon themes (e.g. breeze).
#Icon=teamviewer

# This icon should always be the default TeamViewer icon.
Icon=TeamViewer
Path=
Terminal=false
StartupNotify=true
Togethether with this teamviewer sudoers-file:

Code: Select all

# sudoers file for start/stop teamviewerd
 
%sudo ALL=(root) NOPASSWD: /etc/init.d/teamviewerd

:puppy:

Re: Losing session when screen is locked

Posted: Sun Apr 21, 2019 11:32 am
by oops
fehlix wrote: Sun Apr 21, 2019 10:46 am
oops wrote: Sun Apr 21, 2019 9:56 am FI: I'm using teamviewer not very often too, so:
If AnyDesk cannot be used I use the following teamviewer desktop starter,
while having disabled to start teamviewerd as service during boot:

Code: Select all

[Desktop Entry]
Version=1.0
Encoding=UTF-8
Type=Application
Categories=Network;

Name=TeamViewer 12
#Name=TV12_initD
Comment=Remote Support with Teamviewer
#Exec=/opt/teamviewer/tv_bin/script/teamviewer
Exec=sh -c '( sudo /etc/init.d/teamviewerd status | grep -q running ) || sudo /etc/init.d/teamviewerd start ; /opt/teamviewer/tv_bin/script/teamviewer ; sudo /etc/init.d/teamviewerd stop'

# This icon might be overridden by other icon themes (e.g. breeze).
#Icon=teamviewer

# This icon should always be the default TeamViewer icon.
Icon=TeamViewer
Path=
Terminal=false
StartupNotify=true
Togethether with this teamviewer sudoers-file:

Code: Select all

# sudoers file for start/stop teamviewerd
 
%sudo ALL=(root) NOPASSWD: /etc/init.d/teamviewerd

:puppy:
... Thank you Fehlix ... a good solution.

Re: Losing session when screen is locked

Posted: Mon Apr 22, 2019 5:33 am
by Buck Fankers
fehlix wrote: Sun Apr 21, 2019 10:46 am If AnyDesk cannot be used I use the following teamviewer desktop starter,

Togethether with this teamviewer sudoers-file:

Code: Select all

# sudoers file for start/stop teamviewerd
 
%sudo ALL=(root) NOPASSWD: /etc/init.d/teamviewerd

:puppy:
Allow two quick ninja questions: :grin:

1 - "AnyDesk" couldn't find it in MXIP or Synaptic. Are you guys using some different version/name or I missed it? Is this your preferred remote desktop software for MX?

2 - How do you run / what you do with sudoer file? Is this *.sh file that have execution right and you click on it upon demand? Or has to be run through cli? If so, how?

Re: Losing session when screen is locked

Posted: Mon Apr 22, 2019 7:31 am
by fehlix
Buck Fankers wrote: Mon Apr 22, 2019 5:33 am 1 - "AnyDesk" couldn't find it in MXIP or Synaptic. Are you guys using some different version/name or I missed it? Is this your preferred remote desktop software for MX?
Probaly AnyDesk is not yet within MX Popular Apps, because nobody have yet requested it. That's it.
Buck Fankers wrote: Mon Apr 22, 2019 5:33 am 2 - How do you run / what you do with sudoer file? Is this *.sh file that have execution right and you click on it upon demand? Or has to be run through cli? If so, how?
Ahh, ok sorry. Thats an important part, which I missed to post:
To enabale a password-less start / stop of teamviewer using sudo,
the sudo-password policy need to be placed in a sudoers-file .
To create a file it is imortant to use a special sudoers-editor,
as otherwise any mistake with that policy can creat lot#s of issues.
So the safest way to apply this sudoers-policy is to use the sudoers-editor visudo.
To create this teamviewer sudoers-policy do this:
Within command line type:

Code: Select all

sudo visudo -f /etc/sudoers.d/teamviewer
You will probably see the default terminal editor nano get opened with an empty file.
Now paste the content of this:

Code: Select all

#
# sudoers file for start/stop teamviewerd passwordless
#
# filename : /etc/sudoers.d/teamviewer
#
%sudo ALL=(root) NOPASSWD: /etc/init.d/teamviewerd
Into the editor. To write and close: Press Ctrl+X , Type y ( for yes to save) and Enter
The policy becomes immediately active.
HTH
:puppy:

Re: Losing session when screen is locked

Posted: Mon Apr 22, 2019 7:48 am
by Buck Fankers
fehlix wrote: Mon Apr 22, 2019 7:31 am To enabale a password-less start / stop of teamviewer using sudo,
the sudo-password policy need to be placed in a sudoers-file .
:puppy:
Thank you for all your answers, I really need to figure this remote software before i install MX on bunch of computers that are over 5000 miles away from me, to users that never used Linux before ;-) Will play with Teamviewer next few days.

What is the significance/difference of "password-less start"?
When I try to help someone that someone would not need to enter password? Or I would not need to enter the password or anything else? (never used it yet)

Re: Losing session when screen is locked

Posted: Mon Apr 22, 2019 8:01 am
by fehlix
Buck Fankers wrote: Mon Apr 22, 2019 7:48 am
fehlix wrote: Mon Apr 22, 2019 7:31 am To enabale a password-less start / stop of teamviewer using sudo,
the sudo-password policy need to be placed in a sudoers-file .
:puppy:
Thank you for all your answers, I really need to figure this remote software before i install MX on bunch of computers that are over 5000 miles away from me, to users that never used Linux before ;-) Will play with Teamviewer next few days.
You shall try both Teamviewer and AnyDesk, As I found AnyDesk is more relyable (for me!).
Further I found Teamviewer, when to "often" used, will block you as they seem "think" you appear to violate the for "private use" license.
Buck Fankers wrote: Mon Apr 22, 2019 7:48 am What is the significance/difference of "password-less start"
Teamviewer requires to have a "daemon" running in the background, which needs to be started as root.
The default after installing is: Teamviewr-daemon will always run in background,
which is not needed for me and provides a couple of issues when shutting down or when wake up from suspense.
Hence I disabled the daemon, using

Code: Select all

sudo sysv-rc-conf
but would need now to start the daemon before I can use teamviewer.
Buck Fankers wrote: Mon Apr 22, 2019 7:48 am About "AnyDesk", do you prefer it over teamviewer? How did you install it on MX, with *.deb or building/compiling it yourself?
Yes, for me AnyDesk never failed. Note: The main AnyDesk devoloper are former chief Teamviewer-developer, and started this fresh AnyDesk, shortly after teamviewer was sold to a foreign company.
As we have not yet it with MX Popular Apps,
get a debian deb-package from the AnyDesk website.
:puppy:

Re: Losing session when screen is locked

Posted: Mon Apr 22, 2019 8:18 am
by Buck Fankers
fehlix wrote: Mon Apr 22, 2019 8:01 am
You shall try both Teamviewer and AnyDesk, As I found AnyDesk is more relyable (for me!).
Further I found Teamviewer, when to "often" used, will block you as they seem "think" you appear to violate the for "private use" license.

get a debian deb-package from the AnyDesk website.
:puppy:
OK I understand now everything. Yes I wouldn't like it to keep running in background either. Seems like AnyDesk may be a better choice based on all you wrote, thank you.

I dl AnyDesk from their site, but I got ...tar.gz file. I extracted it and got a folder that I don't know what to do with it. Tried to run few files but unsuccessfully. Since it semms to be better than teamviewer I will ask to be added to MXPI if possible. Thank you for all your time today and all your help!

Re: Losing session when screen is locked

Posted: Mon Apr 22, 2019 9:11 am
by fehlix
Buck Fankers wrote: Mon Apr 22, 2019 8:18 am I extracted it and got a folder that I don't know what to do with it.
The current deb for 32/64 bit files are here:

Code: Select all

https://download.anydesk.com/linux/anydesk_4.0.1-1_amd64.deb
https://download.anydesk.com/linux/anydesk_4.0.1-1_i386.deb
you can install from download location either from Thunar right-click or from CLI

Code: Select all

sudo apt install ./anydesk_4.0.1-1_amd64.deb
Note: Path in front "./" is needed for apt install to work on deb-files.

Re: Losing session when screen is locked

Posted: Mon Apr 22, 2019 12:08 pm
by Buck Fankers
fehlix wrote: Mon Apr 22, 2019 9:11 am

Code: Select all

https://download.anydesk.com/linux/anydesk_4.0.1-1_amd64.deb
https://download.anydesk.com/linux/anydesk_4.0.1-1_i386.deb

Thank you!!!
How in the world I didn't see that link, I will go back to their page and see if I can find it. Sorry for all the trouble. Got it installed, thanks again

Edit, figured it out, what I did wrong, I was using browser that blocks some javascript/or similar stuff. So when i clicked I want Debian/Ubuntu/Mint version, it didn't switch and I got the same 'generic' version which is *.tar.gz