Am 10.01.21 um 12:20 schrieb Tormod Volden:
On Fri, Jan 8, 2021 at 10:00 PM Jamie Zawinski wrote:

In xscreensaver (or maybe lightdm).
Why is xscreensaver started in the lightdm session anyway?
Is xscreensaver really usable as a per user service or should it be per session?
Why is the lightdm xscreensaver instance interfering with the xscreensaver 
instance of the logged in user?
Questions that only the xscreensaver maintainer can answer.

If he thinks there is a genuine systemd issue, then I'd appreciate if it was 
reassigned back with more details.

XScreenSaver author here. I know nothing about lightdm, and didn't write the 
code attempting to integrate the two. However:

1) XScreenSaver should be running as the logged-in user, and terminate when 
they log out. Typically this happens when the X server dies and the $DISPLAY 
socket is closed, but SIGTERM works just as well.

2) It is also reasonable to configure things so that XScreenSaver is running when no one 
is logged in (so that there is a screensaver atop the login screen). If it is launched as 
root, it will setuid to "nobody" at startup, etc. But in this case, when a user 
logs in, it must be killed and re-started as that user.

It was not intentional from my side to have it run in the login window
by default. We used to just ship a systemd unit file that a user could
install if he wanted. Recently, in 5.44+dfsg1-2, we added the
debian/*.user.service file, it was part of a debhlper clean-up from my
package upload sponsor and I didn't foresee the implications.
"lightdm" is a system user (UID < 1000), is possible to have systemd
have it start only for "normal" users?

See man systemd.unit:

       ConditionUser=
           ConditionUser= takes a numeric "UID", a UNIX user name, or the
           special value "@system". This condition may be used to check
           whether the service manager is running as the given user. The
           special value "@system" can be used to check if the user id is
           within the system user range. This option is not useful for system
           services, as the system manager exclusively runs as the root user,
           and thus the test result is constant.

Negating @system might work.
Something like ConditionUser=!@system, but untested.






Attachment: OpenPGP_signature
Description: OpenPGP digital signature

Reply via email to