Dear Experts,
Could someone point me in the right direction: how can I disable hybernate/suspend in CentOS 7?
I get workstations for graduate students with decent amount of RAM (32 GB), and for machines with large RAM I either do not have swap at all of have some small (4 GB) swap. As I remember from older manuals, one has to have at least twice amount of swap compared to physical RAM for hybernate/suspend to work. This probably is what bit me: new Dells came with keyboard that has sleep button, when one hits that button the machine locks up. (it stays powered on, does not respond mouse, keyboard, does not respond ping).
I would like to disable that sleep button on keyboard. (I'm kind of trying to avoid replacing keyboard with the ones that do not have "sleep" key).
Thanks a lot for all your help!
Valeri
++++++++++++++++++++++++++++++++++++++++ Valeri Galtsev Sr System Administrator Department of Astronomy and Astrophysics Kavli Institute for Cosmological Physics University of Chicago Phone: 773-702-4247 ++++++++++++++++++++++++++++++++++++++++
On Thu, Oct 13, 2016 at 11:33 AM, Valeri Galtsev galtsev@kicp.uchicago.edu wrote:
Dear Experts,
Could someone point me in the right direction: how can I disable hybernate/suspend in CentOS 7?
I get workstations for graduate students with decent amount of RAM (32 GB), and for machines with large RAM I either do not have swap at all of have some small (4 GB) swap. As I remember from older manuals, one has to have at least twice amount of swap compared to physical RAM for hybernate/suspend to work. This probably is what bit me: new Dells came with keyboard that has sleep button, when one hits that button the machine locks up. (it stays powered on, does not respond mouse, keyboard, does not respond ping).
I would like to disable that sleep button on keyboard. (I'm kind of trying to avoid replacing keyboard with the ones that do not have "sleep" key).
Have you tried disabling power management via GRUB options? http://askubuntu.com/a/130541
Thanks a lot for all your help!
Valeri
++++++++++++++++++++++++++++++++++++++++ Valeri Galtsev Sr System Administrator Department of Astronomy and Astrophysics Kavli Institute for Cosmological Physics University of Chicago Phone: 773-702-4247 ++++++++++++++++++++++++++++++++++++++++ _______________________________________________ CentOS mailing list CentOS@centos.org https://lists.centos.org/mailman/listinfo/centos
On Thu, October 13, 2016 11:55 am, Mike - st257 wrote:
On Thu, Oct 13, 2016 at 11:33 AM, Valeri Galtsev galtsev@kicp.uchicago.edu wrote:
Dear Experts,
Could someone point me in the right direction: how can I disable hybernate/suspend in CentOS 7?
I get workstations for graduate students with decent amount of RAM (32 GB), and for machines with large RAM I either do not have swap at all of have some small (4 GB) swap. As I remember from older manuals, one has to have at least twice amount of swap compared to physical RAM for hybernate/suspend to work. This probably is what bit me: new Dells came with keyboard that has sleep button, when one hits that button the machine locks up. (it stays powered on, does not respond mouse, keyboard, does not respond ping).
I would like to disable that sleep button on keyboard. (I'm kind of trying to avoid replacing keyboard with the ones that do not have "sleep" key).
Have you tried disabling power management via GRUB options? http://askubuntu.com/a/130541
Mike, thanks! You gave me good enough push into right direction, thanks to which I solved my problem.
Disabling power management via GRUB (boot) options didn't help me. I went further along these lines, tried to tweak related stuff in /etc/systemd/login.conf (systemd experts will probably lough, I'm not one, so... ;-) - didn't help either. I finally came to doing what helped me: edited
/usr/share/polkit-1/actions/org.freedesktop.login1.policy
(replaced "yes" with "no" in a few related places). This solved my problem. I'm not posting what exactly I changed, as I overdid it (disabled locally logged in user's ability to reboot/poweroff machine, and the same from gdm loging screen - I will need to restore these).
Thanks! Valeri
Thanks a lot for all your help!
Valeri
++++++++++++++++++++++++++++++++++++++++ Valeri Galtsev Sr System Administrator Department of Astronomy and Astrophysics Kavli Institute for Cosmological Physics University of Chicago Phone: 773-702-4247 ++++++++++++++++++++++++++++++++++++++++ _______________________________________________ CentOS mailing list CentOS@centos.org https://lists.centos.org/mailman/listinfo/centos
-- ---~~.~~--- Mike // SilverTip257 // _______________________________________________ CentOS mailing list CentOS@centos.org https://lists.centos.org/mailman/listinfo/centos
++++++++++++++++++++++++++++++++++++++++ Valeri Galtsev Sr System Administrator Department of Astronomy and Astrophysics Kavli Institute for Cosmological Physics University of Chicago Phone: 773-702-4247 ++++++++++++++++++++++++++++++++++++++++
On 2016-10-13, Valeri Galtsev galtsev@kicp.uchicago.edu wrote:
On Thu, October 13, 2016 11:55 am, Mike - st257 wrote:
On Thu, Oct 13, 2016 at 11:33 AM, Valeri Galtsev galtsev@kicp.uchicago.edu wrote:
Dear Experts,
Could someone point me in the right direction: how can I disable hybernate/suspend in CentOS 7?
I get workstations for graduate students with decent amount of RAM (32 GB), and for machines with large RAM I either do not have swap at all of have some small (4 GB) swap. As I remember from older manuals, one has to have at least twice amount of swap compared to physical RAM for hybernate/suspend to work. This probably is what bit me: new Dells came with keyboard that has sleep button, when one hits that button the machine locks up. (it stays powered on, does not respond mouse, keyboard, does not respond ping).
I would like to disable that sleep button on keyboard. (I'm kind of trying to avoid replacing keyboard with the ones that do not have "sleep" key).
Have you tried disabling power management via GRUB options? http://askubuntu.com/a/130541
Mike, thanks! You gave me good enough push into right direction, thanks to which I solved my problem.
Disabling power management via GRUB (boot) options didn't help me. I went further along these lines, tried to tweak related stuff in /etc/systemd/login.conf (systemd experts will probably lough, I'm not one, so... ;-) - didn't help either. I finally came to doing what helped me: edited
/usr/share/polkit-1/actions/org.freedesktop.login1.policy
(replaced "yes" with "no" in a few related places). This solved my problem. I'm not posting what exactly I changed, as I overdid it (disabled locally logged in user's ability to reboot/poweroff machine, and the same from gdm loging screen - I will need to restore these).
Thanks! Valeri
Be aware that the file /usr/share/polkit-1/actions/org.freedesktop.login1.policy is not a configfile and will be silently overwritten when systemd is upgraded.
In earlier releases of PolicyLit local changes were made in /etc/polkit-1/localauthority, but I don't know if that approach still works.
Am 14.10.2016 um 10:19 schrieb Liam O'Toole liam.p.otoole@gmail.com:
On 2016-10-13, Valeri Galtsev galtsev@kicp.uchicago.edu wrote:
On Thu, October 13, 2016 11:55 am, Mike - st257 wrote:
On Thu, Oct 13, 2016 at 11:33 AM, Valeri Galtsev galtsev@kicp.uchicago.edu wrote:
Have you tried disabling power management via GRUB options? http://askubuntu.com/a/130541
Mike, thanks! You gave me good enough push into right direction, thanks to which I solved my problem.
Disabling power management via GRUB (boot) options didn't help me. I went further along these lines, tried to tweak related stuff in /etc/systemd/login.conf (systemd experts will probably lough, I'm not one, so... ;-) - didn't help either. I finally came to doing what helped me: edited
/usr/share/polkit-1/actions/org.freedesktop.login1.policy
(replaced "yes" with "no" in a few related places). This solved my problem. I'm not posting what exactly I changed, as I overdid it (disabled locally logged in user's ability to reboot/poweroff machine, and the same from gdm loging screen - I will need to restore these).
Thanks! Valeri
Be aware that the file /usr/share/polkit-1/actions/org.freedesktop.login1.policy is not a configfile and will be silently overwritten when systemd is upgraded.
In earlier releases of PolicyLit local changes were made in /etc/polkit-1/localauthority, but I don't know if that approach still works.
its long time ago but some EL6 workstation have here:
$ cat /etc/polkit-1/localauthority/50-local.d/10-disable-hibernate.pkla [Disable suspend] Identity=unix-group:* Action=org.freedesktop.devicekit.power.hibernate ResultAny=no ResultInactive=no ResultActive=no
-- LF
On Fri, October 14, 2016 5:05 am, Leon Fauster wrote:
Am 14.10.2016 um 10:19 schrieb Liam O'Toole liam.p.otoole@gmail.com:
On 2016-10-13, Valeri Galtsev galtsev@kicp.uchicago.edu wrote:
On Thu, October 13, 2016 11:55 am, Mike - st257 wrote:
On Thu, Oct 13, 2016 at 11:33 AM, Valeri Galtsev galtsev@kicp.uchicago.edu wrote:
Have you tried disabling power management via GRUB options? http://askubuntu.com/a/130541
Mike, thanks! You gave me good enough push into right direction, thanks to which I solved my problem.
Disabling power management via GRUB (boot) options didn't help me. I went further along these lines, tried to tweak related stuff in /etc/systemd/login.conf (systemd experts will probably lough, I'm not one, so... ;-) - didn't help either. I finally came to doing what helped me: edited
/usr/share/polkit-1/actions/org.freedesktop.login1.policy
(replaced "yes" with "no" in a few related places). This solved my problem. I'm not posting what exactly I changed, as I overdid it (disabled locally logged in user's ability to reboot/poweroff machine, and the same from gdm loging screen - I will need to restore these).
Thanks! Valeri
Be aware that the file /usr/share/polkit-1/actions/org.freedesktop.login1.policy is not a configfile and will be silently overwritten when systemd is upgraded.
In earlier releases of PolicyLit local changes were made in /etc/polkit-1/localauthority, but I don't know if that approach still works.
its long time ago but some EL6 workstation have here:
$ cat /etc/polkit-1/localauthority/50-local.d/10-disable-hibernate.pkla [Disable suspend] Identity=unix-group:* Action=org.freedesktop.devicekit.power.hibernate ResultAny=no ResultInactive=no ResultActive=no
Thanks Leon and Liam! You finally set me straight. All works, and other local user abilities stay intact (user can power of or reboot machine, the same can be done from gdm login screen). What finally worked for me (without fear to be overwritten with update) is the following. As you said, I edited (created new) file:
/etc/polkit-1/localauthority/50-local.d/10-disable-hibernate.pkla
This is what I put in it:
[Disable suspend] Identity=unix-group:* #Action=org.freedesktop.devicekit.power.hibernate Action=org.freedesktop.login1.inhibit-handle-suspend-key ResultAny=no ResultInactive=no ResultActive=no
[Disable suspend2] Identity=unix-group:* Action=org.freedesktop.login1.inhibit-handle-hibernate-key ResultAny=no ResultInactive=no ResultActive=no
[Disable suspend3] Identity=unix-group:* Action=org.freedesktop.login1.suspend ResultAny=no ResultInactive=no ResultActive=no
[Disable suspend4] Identity=unix-group:* Action=org.freedesktop.login1.suspend-multiple-sessions ResultAny=no ResultInactive=no ResultActive=no
[Disable suspend5] Identity=unix-group:* Action=org.freedesktop.login1.hibernate ResultAny=no ResultInactive=no ResultActive=no
[Disable suspend6] Identity=unix-group:* Action=org.freedesktop.login1.hibernate-multiple-sessions ResultAny=no ResultInactive=no ResultActive=no
As they say: you don't need to know everything, you only need to know right person you can ask ;-)
Thanks again, everybody!
Valeri
-- LF
CentOS mailing list CentOS@centos.org https://lists.centos.org/mailman/listinfo/centos
++++++++++++++++++++++++++++++++++++++++ Valeri Galtsev Sr System Administrator Department of Astronomy and Astrophysics Kavli Institute for Cosmological Physics University of Chicago Phone: 773-702-4247 ++++++++++++++++++++++++++++++++++++++++
On 13/10/16 16:33, Valeri Galtsev wrote:
Dear Experts,
Could someone point me in the right direction: how can I disable hybernate/suspend in CentOS 7?
I get workstations for graduate students with decent amount of RAM (32 GB), and for machines with large RAM I either do not have swap at all of have some small (4 GB) swap. As I remember from older manuals, one has to have at least twice amount of swap compared to physical RAM for hybernate/suspend to work. This probably is what bit me: new Dells came with keyboard that has sleep button, when one hits that button the machine locks up. (it stays powered on, does not respond mouse, keyboard, does not respond ping).
I would like to disable that sleep button on keyboard. (I'm kind of trying to avoid replacing keyboard with the ones that do not have "sleep" key).
Thanks a lot for all your help!
Valeri
You should be able to do this with PolicyKit:
https://access.redhat.com/solutions/33954
This solution is for RHEL6, but the same polkit rule should work on RHEL7.