| 1 |
// SPDX-License-Identifier: MIT-0 |
| 2 |
// |
| 3 |
// This config file is installed as part of systemd. |
| 4 |
// It may be freely copied and edited (following the MIT No Attribution license). |
| 5 |
// |
| 6 |
// This example can be enabled by symlinking this file to |
| 7 |
// /etc/polkit-1/rules.d/10-systemd-logind-root-ignore-inhibitors.rules |
| 8 |
|
| 9 |
// Allow the root user to ignore inhibitors when calling reboot etc. |
| 10 |
polkit.addRule(function(action, subject) { |
| 11 |
if ((action.id == "org.freedesktop.login1.power-off-ignore-inhibit" || |
| 12 |
action.id == "org.freedesktop.login1.reboot-ignore-inhibit" || |
| 13 |
action.id == "org.freedesktop.login1.halt-ignore-inhibit" || |
| 14 |
action.id == "org.freedesktop.login1.suspend-ignore-inhibit" || |
| 15 |
action.id == "org.freedesktop.login1.hibernate-ignore-inhibit") && |
| 16 |
subject.user == "root") { |
| 17 |
|
| 18 |
return polkit.Result.YES; |
| 19 |
} |
| 20 |
}); |