[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#895152: cinnamon-screensaver: cinnamon-screesaver-command only locks the screen the first time it is called



Package: cinnamon-screensaver
Version: 3.6.1-2
Severity: normal

Dear Maintainer,

Consider the following script:

  var=1
  while true ; do
    sleep 3
    echo Test number $var
    date
    cinnamon-screensaver-command -l --away-message "Test number $var"
    date
    echo 'The screensaver should have started...'
    var=$((var+1));
  done

Running this, I would expect to ensure the screen is locked every 3 seconds.
In the case when the screensaver was already locked when `cinnamon-screensaver-
command -l` is called, I would expect the call to be harmless and return
without doing anything.

However, I see the following output:
Test number 1
Sat  7 Apr 20:52:48 WEST 2018
Sat  7 Apr 20:52:49 WEST 2018
The screensaver should have started... # (1)
Test number 2
Sat  7 Apr 20:52:52 WEST 2018 # (2)
Sat  7 Apr 20:53:02 WEST 2018 # (3)
The screensaver should have started...
^C

(1) tells me that cinnamon-screensaver-command was called and returned.
(2) talls me that we entered the second cycle. cinnamon-screensaver-command was
called (we saw "Test number 2" on the lock screen), but then it does not
return.
The timestamp in (3) is only printed after I enter my password at the locked
screen and press Enter. This tells us that the second call only returns after
the lock screen is dismissed.


I can't see a reason for the cinnamon-screensaver-command to return in the
first call but not in the second. This inconsistency makes it hard to script
more complex behaviours.


Possibly related to this, I also observed that if I send the cinnamon-
screensaver-command call to the background, by adding an '&' to the end of the
line:

  cinnamon-screensaver-command -l --away-message "Test number $var" &


...it will be able to call the command up to 9 times. Starting with the 10th,
the script will output a stack trace on all subsequent calls:

Test number 9
Sat  7 Apr 21:02:43 WEST 2018
[8] 31244
Sat  7 Apr 21:02:43 WEST 2018
The screensaver should have started...
Test number 10
Sat  7 Apr 21:02:46 WEST 2018
[9] 31257
Sat  7 Apr 21:02:46 WEST 2018
The screensaver should have started...
Traceback (most recent call last):
  File "/usr/share/cinnamon-screensaver/cinnamon-screensaver-command.py", line
73, in on_client_ready
    self.perform_action()
  File "/usr/share/cinnamon-screensaver/cinnamon-screensaver-command.py", line
90, in perform_action
    self.client.proxy.call_lock_sync(self.message)
GLib.Error: g-io-error-quark: Timeout was reached (24)
Test number 11
...

After closing the lock screen, killing the script and the pending commands, I
see that all but the first call were hanging in the background.
Why only after the 10th we start seeing tracebacks is also not clear to me.

I believe `cinnamon-screensaver-command -l` should:
 * always return
 * signal any errors with a non-zero return code
 * either lock the screen or do nothing at all if it was already locked.

Note that #895150 is related but more generic than this.

Thanks and best regards,
Luís Picciochi Oliveira



-- System Information:
Debian Release: buster/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.15.0-2-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8), LANGUAGE=en_GB:en (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages cinnamon-screensaver depends on:
ii  cinnamon-desktop-data       3.6.2-2
ii  gir1.2-accountsservice-1.0  0.6.45-1
ii  gir1.2-cinnamondesktop-3.0  3.6.2-2
ii  gir1.2-gkbd-3.0             3.26.0-3
ii  gir1.2-glib-2.0             1.56.0-2
ii  gir1.2-gtk-3.0              3.22.29-2
ii  gir1.2-xapp-1.0             1.0.4-2
ii  iso-flags-png-320x240       1.0.1-1
ii  libc6                       2.27-3
ii  libcscreensaver0            3.6.1-2
ii  libglib2.0-0                2.56.0-4
ii  libgtk-3-0                  3.22.29-2
ii  python3                     3.6.4-1
ii  python3-gi                  3.28.1-1
ii  python3-gi-cairo            3.28.1-1
ii  python3-setproctitle        1.1.10-1+b1
ii  python3-xapp                1.0.1-1
ii  python3-xlib                0.20-3

Versions of packages cinnamon-screensaver recommends:
pn  cinnamon-screensaver-x-plugin  <none>

Versions of packages cinnamon-screensaver suggests:
pn  cinnamon-screensaver-webkit-plugin  <none>

-- no debconf information

Reply to: