4 ms·
> These days, the popular apps try to inhibit blanking by talking to "systemd". The design of the systemd method easily and trivially allows an app to inhibit t
by yrro 6y ago
> These days, the popular apps try to inhibit blanking by talking to "systemd". The design of the systemd method easily and trivially allows an app to inhibit the screen saver, crash, and then never un-inhibit it, so now your screen will never blank again.
> Furthermore, since the systemd method uses cookies to ensure that only the app that sent "inhibit" can send the matching "uninhibit", simply re-launching the crashed video player does not fix the problem.
This sounds like a terrible design. It also doesn't appear to actually match the documentation for systemd-logind's inhibitor locks API:
https://www.freedesktop.org/wiki/Software/systemd/inhibit/ https://www.freedesktop.org/wiki/Software/systemd/inhibit/
The Inhibit method returns a file descriptor:
"As soon as the file descriptor is closed (and all its duplicates) the lock is automatically released. If the client dies while the lock is taken the kernel automatically closes the file descriptor so that the lock is automatically released."
Maybe I'm looking at the wrong documentation? Or maybe the quoted text is a tiresome, ignorant rant?
- maxerickson 6y agoWhat happens if the client freezes?
- yrro 6y agoIt looks like the inhibitior lock stays active. But the design is safe against clients that crash or otherwize exit without uninhibiting. A nice feature request for logind would be an extra optional parameter for the Inhibit call that makes logind require the inhibitor to periodically write to the returned fd to keep the lock from going 'stale'.