Removing Suspend and Hibernate from the gnome menu on RHEL-6

I wrote about how to get rid of the “Suspend” option from gnome’s system menu on RHEL/SL/CentOS-5 in my earlier blog. On RHEL-6, “Suspend” and “Hibernate” are now found under “Shutdown” in the “System” menu in gnome.

To remove these options from the list of available actions, create a PolicyKit file named 10-disable-suspend-hibernate.pkla (for example) with the following contents:

[Disable suspend]
Identity=unix-group:*
Action=org.freedesktop.devicekit.power.suspend;org.freedesktop.devicekit.power.hibernate
ResultAny=no
ResultInactive=no
ResultActive=no

and save it in the /var/lib/polkit-1/localauthority/50-local.d directory.

8 thoughts on “Removing Suspend and Hibernate from the gnome menu on RHEL-6

  1. I’ve been seriously contemplating putting the effort in to package the latest KDE for SL (not sure if I can work it into EPEL directly, though) and this is definitely something that needs to happen on that end as well. Suspend/hibernate are still tricky options and in production can be downright dangerous. The same can be said for power management that kills your screen after 30 minutes by default, and sometimes this is unrecoverable.

  2. i have tried this in my redhat 6.1,but it did not work.
    except for create this file,what should i do?

  3. Did you copy/paste the content? If not, make sure there is no typo. Is the file in the correct location? Try logging out/in.

  4. On my RHEL 6.3 system, either location works. That is, the 10-disable-suspend-hibernate.pkla file can be either in /var/lib/polkit-1/localauthority/50-local.d/ or in /etc/polkit-1/localauthority/50-local.d/ .

    In the case of Fedora, it looks like they made a change that allowed reading from the /etc location in addition to /var/lib:

    https://bugzilla.redhat.com/show_bug.cgi?id=538615
    (comment #43)

    So, this might hold true in RHEL/CentOS/SL as well.