Which application prevents the screen from locking?

Hi,

My system (latest Gnome 42) is set to blank screen in 5 minutes and lock immediately when the screen turns off:

image

Instead of this, I get a notification saying that “An application” prevented the screen from locking.

How can I found out the PID of the application that causes this?

Check the journal.
For example, search for “lock” in less critical messages:

journalctl -b -p4 -g lock

If there is no relevant messages, inspect manually:

journalctl -b -p4
# or
journalctl -b

Read posted man page, for journalctl filtering.

I found the points where this failed:

Jul 11 10:52:31 host gnome-shell[1353]: error: Unable to lock: Lock was blocked by an application
Jul 11 12:24:19 host gnome-shell[1353]: error: Unable to lock: Lock was blocked by an application
Jul 11 13:43:47 host gnome-shell[1353]: error: Unable to lock: Lock was blocked by an application
Jul 11 18:29:30 host gnome-shell[1353]: error: Unable to lock: Lock was blocked by an application
Jul 11 19:06:14 host gnome-shell[1353]: error: Unable to lock: Lock was blocked by an application
Jul 11 19:16:26 host gnome-shell[1353]: error: Unable to lock: Lock was blocked by an application

Unfortunately there is nothing around the messages to help you identify the culprit:

Jul 11 19:01:03 host audit[1]: SERVICE_STOP pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=snapperd comm="systemd" exe="/usr/lib/sy>
Jul 11 19:06:14 host gnome-shell[1353]: error: Unable to lock: Lock was blocked by an application
Jul 11 19:16:26 host gnome-shell[1353]: error: Unable to lock: Lock was blocked by an application
Jul 11 19:21:09 host rtkit-daemon[1572]: Supervising 10 threads of 5 processes of 1 users.

I’ve managed to find that it was “Barrier” causing this though (through a bit of luck and trial/error). Since stopping it the screen locks properly. Will turn it on again and see if I get the same behavior to confirm…

1 Like