A rather controversial possibility on to disable ordinary users from shutting down a machine. The reason for this is that, when a machine is running printrun, controlling the 3D printer, a different user can be logged on in another screen. This last user will shutdown the machine when leaving the therminal, while he should only should be logged out. At the end of the evening, all machines need to be shut down (well, IMHO….).

This can be achieved by creating a file in /etc/polkit-1/localauthority/50-local.d which is called restrict-login-powermgmt.pkla

It should contain:

[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

It still has to be investigated if this can be limited to “leden” so that “Leiders” still can shut down the machine easilly.

  • disable_shutdown_by_users.txt
  • Last modified: 2019/12/04 21:37
  • by gijs