3

I have script running from non-privileged user. It is important, so systemd-inhibit is a good idea. But I get error when trying to inhibit from that user

systemd-inhibit sleep 10
Failed to inhibit: Access denied

This user not so trusted to put him in "wheel" group. How can I grant permission to that user to run systemd-inhibit? (PolicyKit?)

avi9526
  • 143
  • 1
  • 5

1 Answers1

0

If you're trying to inhibit suspension, you can use systemd-inhibit --what=idle as a normal user to prevent the machine from suspending due to system idleness. Other locks require elevated privileges (credits to Aeyoun's answer).

lorcap
  • 1