LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Disable suspend/sleep/hibernate/whatever-you-call-it (https://www.linuxquestions.org/questions/linux-general-1/disable-suspend-sleep-hibernate-whatever-you-call-it-702553/)

arizonagroovejet 02-05-2009 02:09 PM

Disable suspend/sleep/hibernate/whatever-you-call-it
 
My aim is to remove the 'Suspend to RAM' and 'Suspend to Disk' options that appear in KDE 4's Kickoff menu. I do not want them there for users to click on as I can't be doing with worrying about what might happen when a user suspends a machine that relies on a bunch of network services including a network mounted home directory. Especially if they do it to a student workarea machine.

It has been suggested that the way to achieve this is to disable the machine's suspend functionality. But I find myself unable to figure out how to do this. I find loads of discussions about how to stop laptops from automatically going to sleep but nothing about how to completely disable the machine's ability to sleep/hibernate/suspend. Does anyone know how to do this?

JZL240I-U 02-06-2009 01:57 AM

Brute Force: "ACPI=no" in the kernel line of menu.lst. Warning: That will probably influence the temperature watching facilities of modern machines as well.

There should be the possibility to disable things or even edit the menu of KDE. You'll have to dig in the control center for that. I seem to remember that there is a separate editing program, can't remember the name right now.

DragonSlayer48DX 02-06-2009 04:03 AM

Quote:

Originally Posted by JZL240I-U (Post 3433880)
There should be the possibility to disable things or even edit the menu of KDE. You'll have to dig in the control center for that. I seem to remember that there is a separate editing program, can't remember the name right now.

Yes, K Menu Editor & Power Management.

Cheers

arizonagroovejet 02-06-2009 04:22 AM

Quote:

Originally Posted by JZL240I-U (Post 3433880)
Brute Force: "ACPI=no" in the kernel line of menu.lst. Warning: That will probably influence the temperature watching facilities of modern machines as well.

I was negligent in not mentioning that I have tried acpi=no. It removes the 'Suspend to RAM' option but the 'Suspend to Disk' option remains. The 'Suspend to Disk' option also remains if I remove the resume= from the kernel options.
Also uTsing acpi=off is not acceptable because it means the machine no longer powers down when told to shutdown.

Quote:

There should be the possibility to disable things or even edit the menu of KDE. You'll have to dig in the control center for that. I seem to remember that there is a separate editing program, can't remember the name right now.
Yeah one could argue that there should be a configuration option to remove those items but if there is it seems to be very very well hidden. For editing the Kickoff menu there's kmenuedit but that only allows editing of the applications section.


I have now found a solution. There's a script /usr/bin/pm-is-supported
which can be used to determine the suspend capabilities of the machine and KDE 4 evidently uses that to determine whether to show the Suspend options. I say this not because I found it documented anywhere but due to result of experimentation. I replaced pm-is-supported with a script which just does
Code:

exit 1
rebooted the machine and found the Suspend options are no longer listed in Kickoff. This works on openSUSE 11.1 and Kubuntu 8.10. (Though with Kubuntu I've only tested on a virtual machine on which 'Suspend to RAM' was never listed as 'pm-is-supported --hibernate' exits with 1.) It's a hack but it's one I can live either as it's easy to implement. If anyone has any suggestions on a more elegant method of archiving goal it would be interesting to hear.

arizonagroovejet 02-06-2009 04:33 AM

Quote:

Originally Posted by dragonslayer48dx (Post 3433935)
Yes, K Menu Editor & Power Management.

By K Menu Editor I assume you're referring to kmenuedit. kmenuedit does not allow you to edit the contents of Kickoff's Leave section.

As for Power Management then yeah I can see there's a Power Management section in KDE's systemsettings program but when I looked at it before I couldn't see any option in there to remove the Suspend options from Kickoff and I still can't see any such option.


All times are GMT -5. The time now is 05:19 PM.