#854691 xscreensaver: errors in xscreensaver.service systemd unit file

Package:
xscreensaver
Source:
xscreensaver
Description:
Screensaver daemon and frontend for X11
Submitter:
Laurent Bonnaud
Date:
2023-09-28 07:15:02 UTC
Severity:
normal
#854691#5
Date:
2017-02-09 15:11:14 UTC
From:
To:
Dear Maintainer,

here is the problem:

# systemd-analyze verify /usr/lib/systemd/user/xscreensaver.service
[/usr/lib/systemd/user/xscreensaver.service:5] Executable path is not absolute, ignoring: xscreensaver
xscreensaver.service: Service lacks both ExecStart= and ExecStop= setting. Refusing.
xscreensaver.service: Failed to create xscreensaver.service/start: Unit xscreensaver.service is not loaded properly: Invalid argument.

#854691#10
Date:
2017-08-31 02:07:10 UTC
From:
To:
I've attached a patch which fixes the issue.
#854691#15
Date:
2017-10-27 02:23:34 UTC
From:
To:
Jeremy's patch (below) looks reasonable to me.  Even better would be to
have it include other useful metadata in the [Unit] section, like:

Documentation=man:xscreensaver(1)
Documentation=man:xscreensaver-command(1)
Documentation=man:xscreensaver-demo(1)
PartOf=graphical-session.target

xscreensaver(1) currently has a suggestion for this file.  It should
probably also be adjusted to remove the example, and explain
specifically that all the user needs to do is:

   systemctl --user enable xscreensaver

Arguably, this user unit should be enabled by default.  Is there any
reason to ship it disabled?

#854691#20
Date:
2017-12-03 23:14:05 UTC
From:
To:
Thanks for the patch, and for forwarding it here (don't know where it was sent).

Thanks.

I am not so into systemd "units", but possibly relevant to your
question is that it is fully possible that the xscreensaver package is
installed on a system, but that individual users don't want to have it
running. Whether it should start by default for a user depends on the
desktop environment.

Regards,
Tormod

#854691#25
Date:
2017-12-03 23:40:03 UTC
From:
To:
I think if xscreensaver is installed, it should be enabled by default.
desktop environments that don't want it enabled can explicitly disable
it for users which launch them, as can users who for whatever reason
want it disabled.

Most systems won't have xscreensaver installed at all unless the user
has requested it, right?

#854691#30
Date:
2021-04-22 18:55:57 UTC
From:
To:
I think it was explicitely disabled because of this bug:

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=977804
conflicted with the xsession one.

Also: it didn't work, for me. In Debian buster, xscreensaver tried to
start before Xorg was available, and failed to contact the DISPLAY
(server).

In bullseye, however, this unit works:

[Unit]
Description=XScreenSaver
Documentation=man:xscreensaver(1)
Documentation=man:xscreensaver-command(1)
Documentation=man:xscreensaver-demo(1)
PartOf=graphical-session.target

[Service]
ExecStart=/usr/bin/xscreensaver
Restart=on-failure

[Install]
WantedBy=default.target


I suspect that this is the part that doesn't work in buster:

PartOf=graphical-session.target

Also notice this trick:

Restart=on-failure

Which should prevent some security issues from unlocking the screen by
crashing it. It's not quite complete: it should also *lock* the screen
on crash, but it's a start.

#854691#35
Date:
2023-09-28 07:04:35 UTC
From:
To:
On bookworm, with xscreensaver   6.06+dfsg1-3 I had an error trying to
do

systemctl --user enable xscreensaver
Failed to enable unit: Cannot alias xscreensaver.service as
org.jwz.xscreensaver.

so did:
cp  /usr/lib/systemd/user/xscreensaver.service  ~/.config/systemd/user/

(note that the man page says to use
/usr/share/xscreensaver/xscreensaver.service which does not exist as
the source)

Then edited the user copy to edit out
 Alias=org.jwz.xscreensaver

and now
 $ systemctl --user enable xscreensaver

seems to work

John