Friday, May 3, 2024
 Popular · Latest · Hot · Upcoming
3
rated 0 times [  3] [ 0]  / answers: 1 / hits: 513  / 2 Years ago, wed, june 1, 2022, 6:55:46

When I suspend Ubuntu I can't get out of the suspend screen. Yes, I know there are ways to fix this but that would take forever to fix. Is there a way to disable the ability to suspend?


More From » suspend

 Answers
1

To a point you could control this in policykit, in /usr/share/polkit-1/actions/org.freedesktop.upower.policy and or /usr/share/polkit-1/actions/org.freedesktop.login1.policy



The relevant entries would be org.freedesktop.upower.suspend & org.freedesktop.login1.suspend respectively



In that case editing the line <allow_active>yes</allow_active> to <allow_active>no</allow_active> would work.



It's probable that in 13.10 policykit is no longer used for this so those edits would have no effect. In that case you could figure out how hibernate has been disabled & do the same for suspend or cause power management to inhibit suspend altogether.



The latter could be done as such -



sudo nano /etc/pm/sleep.d/00_cancel-suspend



copy & paste this in -



#!/bin/sh
# prevents suspend
. "$PM_FUNCTIONS"
case "${1}" in
suspend)
inhibit
;;
resume)
exit 0
;;
esac


Then on keyboard go



ctrl+o



enter



ctrl+x



to save & exit nano



Finish with -



sudo chmod 0755  /etc/pm/sleep.d/00_cancel-suspend

[#26741] Friday, June 3, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
utschang

Total Points: 357
Total Questions: 120
Total Answers: 119

Location: Croatia
Member since Sat, May 2, 2020
4 Years ago
utschang questions
Mon, Aug 30, 21, 14:09, 3 Years ago
Tue, May 17, 22, 20:44, 2 Years ago
Sun, Jul 11, 21, 23:54, 3 Years ago
Tue, Sep 7, 21, 04:23, 3 Years ago
;