v18 How to disable the Shutdown and Reboot menu option in Ubuntu
#1
Hi,

This is more of a HOW-TO as I have figured out how to permanently hide the Shutdown and Reboot menu items..

I have just installed Kodi in standalone mode on Ubuntu 18, running Kodi v18.6.

I wanted to remove the Shutdown/Reboot menu options as the server it runs on also does other stuff - and after searching many forums etc, the most common solution appeared to be remove from the .xml files - but this I saw as an issue as every time I updated I would need to do it again. Additionally I'm using various web interfaces as well, and some of these could allow shutdowns which would be a pain.

My solution was to create a new file at
Code:
/etc/polkit-1/localauthority/50-local.d/restrict-login-powermgmt.pkla
with the following contents:

Code:

# From: https://askubuntu.com/questions/453479/h...m-in-14-04
[Disable lightdm PowerMgmt]
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

At next restart, Kodi detects it's no longer allowed to shutdown or reboot, and the menu items disappear! Smile

I figured this out looking at the source code, but now it's done, it works well.

I'm running my Kodi as a service based on the files here: https://github.com/graysky2/kodi-standalone-service
Reply
#2
(2020-05-05, 01:30)sillyfrog Wrote: Hi,

I'm running my Kodi as a service based on the files here: https://github.com/graysky2/kodi-standalone-service

 That's the issue. Don't run Kodi as standalone, if you don't want to have those functions exposed to Kodi.
Reply

Logout Mark Read Team Forum Stats Members Help
How to disable the Shutdown and Reboot menu option in Ubuntu0