You are not logged in.
Pages: 1
Hi all,
I've tried to make my XScreenSaver lock when suspending but it seems not to work at all. I followed these instructions on the wiki and created the following xscreensaver.service :
[Unit]
Description=Lock X session using xscreensaver
Before=sleep.target
[Service]
Type=oneshot
ExecStart=/usr/bin/xuserrun /usr/bin/xscreensaver-command -lock
[Install]
WantedBy=sleep.target
But when activating this service through systemd, I got the following status error :
[root@netbook romain]# systemctl status xscreensaver.service
xscreensaver.service - Lock X session using xscreensaver
Loaded: loaded (/etc/systemd/system/xscreensaver.service; enabled)
Active: failed (Result: exit-code) since mar. 2013-05-14 00:13:10 UTC; 11s ago
Process: 16130 ExecStart=/usr/bin/xuserrun /usr/bin/xscreensaver-command -lock (code=exited, status=2)
mai 14 00:13:10 netbook systemd[1]: xscreensaver.service: main process exited, code=exited, status=2/INVALIDARGUMENT
mai 14 00:13:10 netbook systemd[1]: Failed to start Lock X session using xscreensaver.
mai 14 00:13:10 netbook systemd[1]: Unit xscreensaver.service entered failed state.
And if I try to launch the command in ExecStart manually as regular user, I got the following :
Error: Active session is not x11
Any ideas ?
Thanks for reply,
MicroJoe.
Last edited by MicroJoe (2013-05-14 13:02:31)
Offline
Sanity check: You did install xuserrun, yes? What is the output of "which xuserrun"?
Offline
Yes, I installed it through the xuserrun-git package avaible on AUR as recommanded on the wiki :
$ which xuserrun
/usr/bin/xuserrun
I tried to install a stabler version using the xuserrun package on AUR instead but it lead to the same results. If I can't launch the command because of not detecting the x11 server, the problem may be from the xuserrun program ?
I saw this issue on xuserrun's Github repository and I tried to copy/paste the solution in a /opt/xuserrun file. I got the same error of x11 session not detected and if I try to remove the check-x11-is-active-else-return-thing in the script and call it with the xscreensaver-command -lock program, I got the following from XScreenSaver :
romain@netbook ~ » /opt/xuserrun /usr/bin/xscreensaver-command -lock
xscreensaver-command: can't open display
Last edited by MicroJoe (2013-05-14 05:11:24)
Offline
I suggest to change the service file like this:
[Service]
User=microjoe
Type=forking
Environment=DISPLAY=:0
ExecStart=/usr/bin/screensaver-command -lock
Last edited by teateawhy (2013-05-14 09:39:22)
Offline
I suggest to change the service file like this:
[Service] User=microjoe Type=forking Environment=DISPLAY=:0 ExecStart=/usr/bin/screensaver-command -lock
As far as I know, xscreensaver-command does no forking. Stick with Type=oneshot.
Offline
Thanks ! It works well using teateawhy's Service except I kept the oneshot.
What about the wiki? Do you think I should edit it to post this solution as a subtitute for the actual one?
(Meanwhile, querying « XScreenSaver autolock » on Google leads directly to this topic created yesterday ; impressive)
Offline
Pages: 1