This solution is a combination of @Jeroen's solution and @A lubuntu user solution.
The root cause, I believe, is that the user-specific light-locker.desktop
file doesn't override the system-wide one. So, even if the user configures light-locker to not start at all, it still runs with the default configuration parameters.
Warning: This will disable system-wide default screen locking. If you want to enable locking for a specific user, you'll need to edit the Exec=
line in the ~/.config/autostart/light-locker.desktop
file for each user. Configuring this through "Preferences >> Light Locker Settings" may do this (once the system-wide file is moved out of the way), but I haven't tried this.
Step 1: Disable system-wide startup of light-locker. This will allow the per-user .desktop file to be executed instead.
sudo mv /etc/xdg/autostart/light-locker.desktop /etc/xdg/autostart/light-locker.desktop.bak
To re-enable this, you would just rename the file so it no longer has the .bak
extension.
Step 2: Edit the user-specific light-locker.desktop file
Open ~/.config/autostart/light-locker.desktop in a text editor.
Edit the line that begins Exec=
so it is only Exec=
. That is, there is no command specified which means light-locker won't be started.
Step 3: Reboot.
TL;DR: light-locker keeps the screen black if systemd cannot read /proc
light-locker
depends on dbus
providing IPC
.
dbus
depends on systemd-logind
providing session
information.
systemd-logind
depends on /proc
providing process
information.
Meaning this will not work very well together:
$ file /sbin/init
/sbin/init: symbolic link to /lib/systemd/systemd
$ mount | grep proc
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime,hidepid=2,gid=1337)
And neither can be expected to:
hidepid isn't really compatible with systemd. sorry. [..] Anyway, closing as this was not caused by systemd. -- Lennart Poettering
Partial Solution 1
Partial solution, because it comes with information disclosure.
Allow unprivileged programs (such as systemd, after dropping privileges) to access other users process info in /proc
.
$ sudo mount -o remount,hidepid=0 /proc
# and fix /etc/fstab accordingly
Partial Solution 2
Partial solution, because systemd might break in other places, not just logind.
Add systemd-logind to the appropriate group, most conveniently achieved by adding a service Drop-In.
$ addgroup showpid
$ adduser myuser showpid
$ sudo mount -o remount,hidepid=2,gid=showpid /proc
# and fix /etc/fstab accordingly
$ echo -e '[Service]\nSupplementaryGroups=showpid' | sudo tee /etc/systemd/system/systemd-logind.service.d/10-showpid.conf
$ sudo systemctl daemon-reload
$ sudo systemctl restart systemd-logind
After either solution, the Got session-id: (null)
message should look more like Got session-id: /org/freedesktop/login1/c7
and light-locker will be able to communicate properly via dbus
.
What should i have done do figure this out way faster?
- If something changed, and you cannot quickly figure out what changed, just grab the backup already and
diff -ruiN
the whole system.
- Document the first time an issue occured more precisely, so sorting logfiles/IDS reports by time will quickly reveal the relevant cause.
- File more bug reports. Applications silently failing under conditions that will later cause headache and/or system lockup is unacceptable.
Best Answer
light-locker is buggy, see e.g. Bug #1832960, Bug #1855753
In 19.10 you can use
xfce4-screensaver
for locking, instead oflight-locker
. In 18.04 (and in 19.10) you could usexscreensaver
instead oflight-locker
. You have to install the screensaver first. Make sure only the one you use is autostarted during login in "Session and Startup" dialog.You could use which locker you want with Xubuntu 19.10, see here for instructions. As an administrator you could use any locker with an older release, too, by putting your version of
xflock4
script in /usr/local/bin. (Otherwise the default version at /usr/bin/ is used.)