Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

phoronix-test-suite benchmark disables lock screen and screen blanking, and doesn't enable them back #291

Closed
amezin opened this issue Sep 7, 2018 · 8 comments

Comments

@amezin
Copy link

amezin commented Sep 7, 2018

I've noticed that after I ran phoronix-test-suite benchmark screen locking and blanking are disabled in Gnome (and to reenable the lock screen I have to edit gnome settings in dconf). This isn't very convenient :)

Wouldn't it be better to inhibit the "screensaver" through org.freedesktop.ScreenSaver D-bus interface (which is supported by at least Gnome, KDE and Cinnamon) while the benchmark is running?
It could work like this:

  1. Register the phoronix-test-suite process on the session bus under some unique name ("org.phoronix.benchmark", or "org.phoronix.benchmark.<some_unique_string>" if concurrent processes are necessary)
  2. Call org.freedesktop.ScreenSaver /org/freedesktop/ScreenSaver.Inhibit("org.phoronix.benchmark.<some_unique_string>", "Benchmark is running")
  3. Screensaver/screen locking will be reenabled automatically when the process disappears from the bus (when the process exits)
@michaellarabel
Copy link
Member

PTS does set it back, at least I haven't had any issues on my number of GNOME2/GNOME3 systems.... The only time it wouldn't be setting it back is if you interrupt the PTS process so it's not able to complete its shutdown tasks.

The Dbus screensaver inhibit isn't used since AFAIK isn't a way to nicely handle it from PHP programs. Or does there happen to be some nicely way to handle it? Thanks.

@amezin
Copy link
Author

amezin commented Sep 7, 2018

Yes, after further testing I can confirm that it only happens if I interrupt the benchmark (Ctrl+C, sigint). But is it impossible to run these shutdown tasks when the program is interrupted too?

I've googled a bit and found these D-Bus bindings for PHP: https://github.com/derickr/pecl-dbus Though I'm not sure whether they will work or not. Another option is writing a small module in C

@Mercotui
Copy link

Suppose one does end up interrupting the benchmark, as it took too long and they wanted to go home.
How would they be able to lock their desktop again?
Rebooting doesn't seem to fix it.
I have also tried running another (shorter) test to completion, still cant lock the desktop.

@Mercotui
Copy link

Ah,

dconf write /org/gnome/desktop/lockdown/disable-lock-screen false

did the trick.

@mmstick
Copy link

mmstick commented Aug 1, 2019

You can solve this without tampering with dconf variables by running phoronix with the systemd-inhibit command. If the phoronix binary in PATH was merely a shell script that runs systemd-inhibit /actual/path/to/phoronix-test-suite $args[@], you could fix this. No PHP required.

@bobzurad
Copy link

bobzurad commented Dec 8, 2020

For some reason

dconf write /org/gnome/desktop/lockdown/disable-lock-screen false

didn't work for me.

I had to use

gsettings reset org.gnome.desktop.lockdown disable-lock-screen

to restore my lock screen.

@serebit
Copy link
Contributor

serebit commented Jan 3, 2021

I've spent over half a year trying to figure out why my desktop and laptop kept disabling my lock screen at seemingly random intervals. Changing dconf settings is not the way to accomplish this. Please reconsider.

@ispanos
Copy link

ispanos commented Oct 28, 2023

I propose a signal trap such that when ctrl+c is used to stop the test, you re-enable lock. And/or throw a large error to warn about this. The first time I used the PTS it didn't finish before I had to leave for class and my laptop was left in class (lid down) multiple time without locking.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants