Lock screen doesn't work

I have had lots of issues with the lock screen in MATE. CTRL+ALT+L doesn't seem to do anything most of the time. Selecting lock from the menu does nothing most of the time. And there are times where I shut the laptop lid and open it and there is no lockscreen I am just right into the system.

I did submit a bug report that popped up about it also I am seeing the following.

$ grep -i screensaver ~/.xsession-errors
mate-session[1560]: WARNING: Detected that screensaver has left the bus
** Message: 23:43:32.787: Screensaver is not running!
** Message: 23:43:48.744: Screensaver is not running!
** Message: 23:44:14.778: Screensaver is not running!
** Message: 23:44:17.618: Screensaver is not running!
mate-session[1560]: WARNING: Detected that screensaver has left the bus
** Message: 11:08:58.813: Screensaver is not running!
** Message: 11:09:05.115: Screensaver is not running!
** Message: 11:09:14.960: Screensaver is not running!
** Message: 11:09:28.550: Screensaver is not running!
** Message: 11:09:28.769: Screensaver is not running!
** Message: 11:09:28.967: Screensaver is not running!
** Message: 11:09:29.125: Screensaver is not running!
** Message: 11:09:29.285: Screensaver is not running!
** Message: 11:09:31.808: Screensaver is not running!
** Message: 11:09:31.989: Screensaver is not running!
** Message: 11:09:32.124: Screensaver is not running!
** Message: 11:19:53.665: Screensaver is not running!

any ideas how to work around this?

I did some more testing and it does seem to work sometimes. I believe it's related to this bug not sure when this might be slated for an update Bug #1943369 “mate-screensaver crashed with SIGSEGV in matemenu_...” : Bugs : mate-menus package : Ubuntu

Hi DCMike, Welcome to the community :slight_smile:

Screensaver dies after about two days running, more or less ?

At the moment i'm running a script that restarts the screensaver automatically after it dies (and adds a line to a log).
No problems with locking at the moment.

BTW, the default for screenlocking in the windowmanager is Windowkey+L,

If you also have screenlocking in 'shortcuts' (probably a 'caja' thing) , disable it.
(and tell me if you had, it might conflict )

If you, after you removed the shortcut , try to lock and it doesn't work, can you issue this commands and see if locking works afterwards ?

gsettings set org.mate.Marco.global-keybindings run-command-1 '<Mod4>l'
gsettings set org.mate.Marco.keybinding-commands command-1 'mate-screensaver-command --lock'

If you don't like Windowkey+L , you can change it to CTRL+ALT+L with:
gsettings set org.mate.Marco.global-keybindings run-command-1 '<Control><Alt>l'

Oh BTW, here is my workaround for the crashing screensaver:

EDIT: added 3 lines to the code, removed debug parameter

#!/bin/bash
     
# to be the only instance, kill all the others, but not yourself
kill -SIGKILL $( pgrep "${0##*/}" |grep -v "$$" )

# kill the running version of screensaver
killall -SIGKILL mate-screensave
sleep 1

# logfile, name it whatever you like
logfile="$HOME/screencrash.log"

while :
do
	mate-screensaver --no-daemon  &>>"$logfile"
	date +'screensaver died at %Y-%m-%d  %H:%M' >>"$logfile"
	sleep 5
done

Name this script "screensaverfix" or something like that
make it executable after you saved it

In the control-center open startup-applications,
disable the regular screensaver startup entry,
make a new startup entry and
put something like this in the command section:
nohup /path/to/screensaverfix

1 Like

Thanks for all the suggestions things have been stable past day or so. I am going to keep an eye on it and if it comes back up I will try these workarounds.

I just tried this script out and it did fix it for me when the screen wouldn't lock

2 Likes

The logfile will grow pretty fast.
So if everything keeps on working for a week, you can remove the --debug &>>"$logfile" option from the script, that will stop the flood of logmessages.

You can delete the logfile whenever you like.

I woke up this morning opened my laptop and I was right in with no screensaver or lockscreen. I checked the log and this is what I am seeing over and over again

** (mate-screensaver:122554): WARNING **: 05:02:11.405: screensaver already running in this session
screensaver died at 2021-12-19 05:02
[gs_debug_init] gs-debug.c:110 (05:02:16): Debugging enabled
[main] mate-screensaver.c:93 (05:02:16): initializing mate-screensaver 1.26.0
[init_session_id] gs-listener-dbus.c:2474 (05:02:16): Got session-id: /org/freedesktop/login1/session/c2
[gs_fade_init] gs-fade.c:905 (05:02:16): Fade type: 3
[set_status] gs-watcher-x11.c:358 (05:02:16): GSWatcher: not active, ignoring status changes
[gs_watcher_set_active] gs-watcher-x11.c:284 (05:02:16): turning watcher: ON

See

for solution.

excellent thanks for all the help everyone I think the workaround I have in place is manageable until a fix comes out I will mark this as resolved.

Won't that break multiseat configs and/or remote sessions running a locked screensaver?

1 Like

Hmmm....Multiseat or RDP you mean ?
Haven't thought of that.
If you are logged in twice on multiseat (don't know for RDP) , one of the two session-screensavers would be killed by the other. To make this multi-seat, the script would be a bit more complex to facilitate that. I think that is a bit beyond the stopgap character of this workaround.

AAMF, I don't use multiseat or RDP (everything here is via ssh) so I am not really in a position to tackle that.

1 Like