udisks
udisks copied to clipboard
Udisksd inhibits screen lock
Udisks daemon inhibits automatic screen lock during raid check (and other long running tasks I suppose), which is a security issue for user devices like desktop or laptop. While screen lock shouldn't affect long running jobs negatively, this means that there shoudn't be any reason to inhibit it.
True, certain type of jobs do not need to submit an inhibit, though I guess it was more meant as machine-sleep-inhibit than screen-lock-inhibit.
I've looked again at source code and systemd docs, and noticed that "idle" inhibition that udidskd uses covers any automatic actions on idle.
idle inhibits that the system goes into idle mode, possibly resulting in automatic system suspend or shutdown depending on configuration
https://www.freedesktop.org/wiki/Software/systemd/inhibit/
So looks like it's not possible from the udisksd side to inhibit automatic sleep/hibernate but still let system lock, because API doesn't have enough granularity.
Right, the granularity for the idle inhibit is too coarse, nothing we can do from UDisks side.
However, we have been getting bugreports about unnecessary inhibit lock held for the kind of mdraid sync actions that are typically restartable upon system reboots. That led me to introduce slighly relaxed rules: #1342. This includes an ability to avoid acquiring inhibit lock through an optional extra argument. We still want the default behaviour unchanged, i.e. it may be desirable to have the array sync operation priority and prevent accidental sleep. Callers to the org.freedesktop.UDisks2.MDRaid.RequestSyncAction() method would need to add a choice to the user (e.g. a checkbox in the GUI) to skip inhibiting.
The PR also makes it easier for any other method call to offer avoiding inhibit lock, subject to future API enhancements.