I had to figure out how to remove the shutdown/restart etc. options from the exit menu of Kodi. I also had a problem that the power button on remote caused machine to shutdown and power off!
Disabling Shutdown, Restart etc. was accomplished by help of PolicyKit. We simply have to define policy file which disables these actions by users. (this obviously won't effect these operations being executed from shell)
Into
/etc/polkit-1/localauthority/50-local.d/disable-shutdown.pkla
file, added:[Disable shutdown etc.] Identity=unix-user:* Action=org.freedesktop.login1.reboot;org.freedesktop.login1.reboot-multiple-sessions;org.freedesktop.login1.power-off;org.freedesktop.login1.power-off-multiple-sessions;org.freedesktop.login1.suspend;org.freedesktop.login1.suspend-multiple-sessions;org.freedesktop.login1.hibernate;org.freedesktop.login1.hibernate-multiple-sessions ResultAny=no ResultInactive=no ResultActive=no
You can restart it by issuing
sudo systemctl restart polkit
Now, disabling the power button on remote is accomplished by editing
/etc/systemd/logind.conf
and adding the following line HandlePowerKey=ignore
. Then you should restart systemd-logind by issuing sudo systemctl restart systemd-logind
Hopefully this would have resolved the issue for you also. Good luck!
No comments:
Post a Comment