On 2017-01-07 11:29, nicholas wrote:
not a direct solution, but to add to options: https://www.freedesktop.org/software/systemd/man/systemd-inhibit.html
Ah... Interesting. --mode= Takes either "block" or "delay" and describes how the lock is applied. If "block" is used (the default), the lock prohibits any of the requested operations without time limit, and only privileged users may override it. If "delay" is used, the lock can only delay the requested operations for a limited time. If the time elapses, the lock is ignored and the operation executed. The time limit may be specified in logind.conf(5). Note that "delay" is only available for "sleep" and "shutdown". But it is for executing a program. Example # systemd-inhibit wodim foobar.iso This burns the ISO image foobar.iso on a CD using wodim(1), and inhibits system sleeping, shutdown and idle while doing so. So not for an automatic lock if a condition is met. -- Cheers / Saludos, Carlos E. R. (from 42.2 x86_64 "Malachite" at Telcontar)