mate-desktop / mate-power-manager

Power management tool for the MATE desktop
https://mate-desktop.org
GNU General Public License v2.0
59 stars 51 forks source link

Systemd inhibitors are ignored #301

Open knezi opened 4 years ago

knezi commented 4 years ago

Expected behaviour

When an inhibitor is set, the machine should not shutdown/hibernate/sleep in the same way systemctl hibernate/... does.

Actual behaviour

When you close the laptop lid or press the power button, it ignores any inhibitors set.

Steps to reproduce the behaviour

Run the following to set inhibitors for all actions.

systemd-inhibit --mode=block --what shutdown:sleep:idle:handle-power-key:handle-suspend-key:handle-hibernate-key:handle-lid-switch --who me sleep 999999h

Now if you run systemctl suspend, you get:

Operation inhibited by "me" (PID 146681 "systemd-inhibit", user knezi), reason is "Unknown reason".
Please retry operation after closing inhibitors and logging out other users.
Alternatively, ignore inhibitors and users with 'systemctl suspend -i'.

The same happens if systemd handles these operation itself. However, when you set this by MPM, it happily ignores the inhibitors.

MATE general version

N/A

Package version

Name            : mate-power-manager
Version         : 1.22.1-1

Linux Distribution

Arch linux